/ neko /

记录详情

Runtime Error


  
# 状态 耗时 内存占用
#1 Accepted 84ms 9.086 MiB
#2 Accepted 83ms 9.082 MiB
#3 Wrong Answer 84ms 9.156 MiB
#4 Wrong Answer 84ms 9.082 MiB
#5 Accepted 84ms 9.086 MiB
#6 Wrong Answer 84ms 9.082 MiB
#7 Wrong Answer 84ms 9.082 MiB
#8 Accepted 84ms 9.078 MiB
#9 Runtime Error 85ms 9.09 MiB
#10 Accepted 83ms 9.082 MiB
#11 Runtime Error 85ms 9.129 MiB
#12 Runtime Error 85ms 9.109 MiB
#13 Runtime Error 85ms 9.117 MiB
#14 Runtime Error 84ms 9.082 MiB
#15 Wrong Answer 84ms 9.09 MiB
#16 Wrong Answer 83ms 9.082 MiB
#17 Runtime Error 84ms 9.113 MiB
#18 Wrong Answer 83ms 9.082 MiB
#19 Wrong Answer 85ms 9.082 MiB
#20 Wrong Answer 84ms 9.078 MiB
#21 Wrong Answer 84ms 9.094 MiB
#22 Runtime Error 84ms 9.121 MiB
#23 Runtime Error 85ms 9.113 MiB
#24 Runtime Error 84ms 9.121 MiB
#25 Accepted 85ms 9.09 MiB
#26 Runtime Error 85ms 9.137 MiB
#27 Runtime Error 86ms 9.125 MiB
#28 Runtime Error 85ms 9.082 MiB
#29 Runtime Error 86ms 9.129 MiB
#30 Runtime Error 84ms 9.113 MiB
#31 Runtime Error 87ms 9.121 MiB
#32 Runtime Error 87ms 9.145 MiB
#33 Runtime Error 85ms 9.121 MiB
#34 Runtime Error 85ms 9.125 MiB
#35 Runtime Error 87ms 9.117 MiB
#36 Accepted 88ms 9.102 MiB
#37 Runtime Error 88ms 9.148 MiB
#38 Runtime Error 85ms 9.129 MiB
#39 Runtime Error 86ms 9.129 MiB
#40 Runtime Error 86ms 9.125 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 {
      
                left=right;
                right++;
                i=0;
            }
        }
        return -1;
    }
}

信息

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