QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#59726#1371. Missing Numberabdelrahman001#WA 0ms3428kbC++20688b2022-10-31 22:19:132022-10-31 22:19:17

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-31 22:19:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3428kb
  • [2022-10-31 22:19:13]
  • 提交

answer

#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
const int N = 1e5 + 5;
int n;
string s;
bool done[N];
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n >> s;
    int cur = 1;
    for(int j = 0;j < s.size();j++) {
		string tmp = to_string(cur);
		if(j + tmp.size() > s.size())
			return cout << cur, 0;
		if(s.substr(j, tmp.size()) == tmp) {
			j += tmp.size() - 1;
			cur++;
		} else {
			return cout << cur, 0;
		}
	}
    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3428kb

input:

2
1

output:


result:

wrong answer 1st lines differ - expected: '2', found: ''