/ neko /

记录详情

Runtime Error


  
# 状态 耗时 内存占用
#1 Wrong Answer 84ms 9.082 MiB
#2 Wrong Answer 83ms 9.07 MiB
#3 Wrong Answer 84ms 9.074 MiB
#4 Wrong Answer 83ms 9.082 MiB
#5 Wrong Answer 96ms 9.328 MiB
#6 Wrong Answer 83ms 9.082 MiB
#7 Wrong Answer 85ms 9.082 MiB
#8 Wrong Answer 99ms 9.789 MiB
#9 Runtime Error 100ms 9.922 MiB
#10 Wrong Answer 85ms 9.086 MiB
#11 Runtime Error 103ms 9.812 MiB
#12 Runtime Error 100ms 9.789 MiB
#13 Runtime Error 102ms 9.922 MiB
#14 Runtime Error 102ms 9.805 MiB
#15 Wrong Answer 85ms 9.086 MiB
#16 Wrong Answer 85ms 9.074 MiB
#17 Runtime Error 99ms 9.797 MiB
#18 Wrong Answer 85ms 9.066 MiB
#19 Wrong Answer 98ms 9.789 MiB
#20 Wrong Answer 96ms 9.789 MiB
#21 Wrong Answer 86ms 9.074 MiB
#22 Runtime Error 98ms 9.828 MiB
#23 Runtime Error 100ms 9.824 MiB
#24 Runtime Error 100ms 9.898 MiB
#25 Wrong Answer 88ms 9.094 MiB
#26 Runtime Error 94ms 9.18 MiB
#27 Runtime Error 101ms 9.848 MiB
#28 Runtime Error 102ms 9.914 MiB
#29 Runtime Error 102ms 9.859 MiB
#30 Runtime Error 99ms 9.812 MiB
#31 Runtime Error 99ms 9.832 MiB
#32 Runtime Error 100ms 9.914 MiB
#33 Runtime Error 100ms 9.84 MiB
#34 Runtime Error 100ms 9.93 MiB
#35 Runtime Error 102ms 9.848 MiB
#36 Wrong Answer 87ms 9.082 MiB
#37 Runtime Error 102ms 9.398 MiB
#38 Runtime Error 100ms 9.828 MiB
#39 Runtime Error 102ms 9.918 MiB
#40 Runtime Error 101ms 9.84 MiB

代码

import java.util.*;
public class Main {
 public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String a=in.next();
        StringBuilder b=new StringBuilder();
        for (int i=0;i<110;i++){
            b.append(i);
        }
        String c=b.toString();
        Main kksk=new Main();
        int ans=kksk.index(c,a);
        System.out.println(ans);

    }

    private int index(String a,String b) {
        int right=0,left=0;
        for (int i=0;i<b.length();i++){
            if (b.charAt(i)==a.charAt(right)){
                right++;
                if (right-left==b.length()){
                    return left;
                }
            }else {
                System.out.println(left);
                left=right;
                right++;
                i=0;
            }
        }
        return -1;
    }
}

信息

递交者
类型
递交
题目
P1014 超长数字串
题目数据
下载
语言
Java
递交时间
2021-02-18 18:12:45
评测时间
2021-02-18 18:12:45
评测机
分数
0
总耗时
3818ms
峰值内存
9.93 MiB