/ neko /

记录详情

Runtime Error


  
# 状态 耗时 内存占用
#1 Accepted 80ms 9.094 MiB
#2 Accepted 80ms 9.082 MiB
#3 Wrong Answer 80ms 9.07 MiB
#4 Wrong Answer 80ms 9.082 MiB
#5 Wrong Answer 80ms 9.094 MiB
#6 Wrong Answer 80ms 9.059 MiB
#7 Wrong Answer 82ms 9.082 MiB
#8 Accepted 82ms 9.082 MiB
#9 Runtime Error 82ms 9.082 MiB
#10 Accepted 81ms 9.078 MiB
#11 Runtime Error 82ms 9.117 MiB
#12 Runtime Error 82ms 9.082 MiB
#13 Runtime Error 82ms 9.09 MiB
#14 Runtime Error 81ms 9.207 MiB
#15 Wrong Answer 82ms 9.094 MiB
#16 Wrong Answer 82ms 9.09 MiB
#17 Runtime Error 82ms 9.121 MiB
#18 Wrong Answer 81ms 9.078 MiB
#19 Wrong Answer 80ms 9.09 MiB
#20 Wrong Answer 80ms 9.078 MiB
#21 Wrong Answer 81ms 9.086 MiB
#22 Runtime Error 82ms 9.109 MiB
#23 Runtime Error 82ms 9.113 MiB
#24 Runtime Error 82ms 9.113 MiB
#25 Accepted 82ms 9.086 MiB
#26 Wrong Answer 82ms 9.098 MiB
#27 Runtime Error 83ms 9.117 MiB
#28 Runtime Error 82ms 9.125 MiB
#29 Runtime Error 83ms 9.223 MiB
#30 Runtime Error 81ms 9.125 MiB
#31 Runtime Error 82ms 9.094 MiB
#32 Runtime Error 81ms 9.207 MiB
#33 Runtime Error 82ms 9.117 MiB
#34 Runtime Error 82ms 9.125 MiB
#35 Runtime Error 81ms 9.117 MiB
#36 Accepted 82ms 9.102 MiB
#37 Runtime Error 84ms 9.102 MiB
#38 Runtime Error 82ms 9.086 MiB
#39 Runtime Error 82ms 9.121 MiB
#40 Runtime Error 82ms 9.117 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+1==b.length()){
                    return left;
                }
            }else {
                left=right;
                right++;
                i=0;
            }
        }
        return -1;
    }
}


信息

递交者
类型
递交
题目
P1014 超长数字串
题目数据
下载
语言
Java
递交时间
2021-02-18 18:22:58
评测时间
2021-02-18 18:22:58
评测机
分数
60
总耗时
3281ms
峰值内存
9.223 MiB