QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#142275 | #1371. Missing Number | Anwar_Gehad_Maghraby# | RE | 0ms | 0kb | C++23 | 520b | 2023-08-18 21:22:04 | 2023-08-18 21:22:06 |
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
const int N = 1e5 + 10;
int main() {
cin.tie(0);cin.sync_with_stdio(0);
cout.tie(0);cout.sync_with_stdio(0);
int n; cin >> n;
string s; cin >> s;
for (int i = 0, j = 1; j <= n; ++j) {
int x = j, sz = 0;
while (x) {
x /= 10;
sz++;
}
if (stoi(s.substr(i, sz)) != j) {
cout << j;
return 0;
}
i += sz;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
2 1