QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#821536 | #9063. Champernowne Verification | Teapot# | AC ✓ | 1ms | 3816kb | C++14 | 1.3kb | 2024-12-19 16:30:11 | 2024-12-19 16:30:12 |
Judging History
answer
/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
ll n = sz(s);
char res = '0';
FOR(i,0,n)
{
if(s[i]== res+1)
res++;
else{
res = 'a';
break;
}
}
if(res == 'a')
cout << -1;
else
cout << res--;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3656kb
input:
123456789
output:
9
result:
ok single line: '9'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1000000000
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
11
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1324
output:
-1
result:
ok single line: '-1'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3760kb
input:
41
output:
-1
result:
ok single line: '-1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
72841877
output:
-1
result:
ok single line: '-1'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
8258
output:
-1
result:
ok single line: '-1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
12345
output:
5
result:
ok single line: '5'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
204
output:
-1
result:
ok single line: '-1'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
76254
output:
-1
result:
ok single line: '-1'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
444
output:
-1
result:
ok single line: '-1'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
34567490
output:
-1
result:
ok single line: '-1'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
30246
output:
-1
result:
ok single line: '-1'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
52
output:
-1
result:
ok single line: '-1'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
768582
output:
-1
result:
ok single line: '-1'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
72200
output:
-1
result:
ok single line: '-1'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
24729349
output:
-1
result:
ok single line: '-1'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
123465789
output:
-1
result:
ok single line: '-1'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
58912
output:
-1
result:
ok single line: '-1'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
51494
output:
-1
result:
ok single line: '-1'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
123546
output:
-1
result:
ok single line: '-1'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
4527800
output:
-1
result:
ok single line: '-1'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
12345678
output:
8
result:
ok single line: '8'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
2612
output:
-1
result:
ok single line: '-1'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
17
output:
-1
result:
ok single line: '-1'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
1324567
output:
-1
result:
ok single line: '-1'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
8020
output:
-1
result:
ok single line: '-1'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
56
output:
-1
result:
ok single line: '-1'
Test #29:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
124026951
output:
-1
result:
ok single line: '-1'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
292386603
output:
-1
result:
ok single line: '-1'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
53
output:
-1
result:
ok single line: '-1'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
588
output:
-1
result:
ok single line: '-1'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
5636619
output:
-1
result:
ok single line: '-1'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
87387385
output:
-1
result:
ok single line: '-1'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
647403
output:
-1
result:
ok single line: '-1'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
2124484
output:
-1
result:
ok single line: '-1'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
878876
output:
-1
result:
ok single line: '-1'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
2713
output:
-1
result:
ok single line: '-1'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
225066
output:
-1
result:
ok single line: '-1'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
16
output:
-1
result:
ok single line: '-1'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
8861341
output:
-1
result:
ok single line: '-1'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
465301583
output:
-1
result:
ok single line: '-1'
Test #43:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
28821160
output:
-1
result:
ok single line: '-1'
Test #44:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
38227370
output:
-1
result:
ok single line: '-1'
Test #45:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
6407522
output:
-1
result:
ok single line: '-1'
Test #46:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
59771
output:
-1
result:
ok single line: '-1'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
172
output:
-1
result:
ok single line: '-1'
Test #48:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
6384
output:
-1
result:
ok single line: '-1'
Test #49:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
123456
output:
6
result:
ok single line: '6'
Test #50:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
938
output:
-1
result:
ok single line: '-1'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
19
output:
-1
result:
ok single line: '-1'
Test #52:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
68
output:
-1
result:
ok single line: '-1'
Test #53:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
162149411
output:
-1
result:
ok single line: '-1'
Test #54:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
44616
output:
-1
result:
ok single line: '-1'
Test #55:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
699317
output:
-1
result:
ok single line: '-1'
Test #56:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
508621
output:
-1
result:
ok single line: '-1'
Test #57:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
474249229
output:
-1
result:
ok single line: '-1'
Test #58:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
765922
output:
-1
result:
ok single line: '-1'
Test #59:
score: 0
Accepted
time: 0ms
memory: 3744kb
input:
270066653
output:
-1
result:
ok single line: '-1'
Test #60:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
1234567
output:
7
result:
ok single line: '7'
Test #61:
score: 0
Accepted
time: 0ms
memory: 3480kb
input:
123
output:
3
result:
ok single line: '3'
Test #62:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
12346578
output:
-1
result:
ok single line: '-1'
Test #63:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
756537
output:
-1
result:
ok single line: '-1'
Test #64:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
1234
output:
4
result:
ok single line: '4'
Test #65:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
767
output:
-1
result:
ok single line: '-1'
Test #66:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
56488
output:
-1
result:
ok single line: '-1'
Test #67:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
818
output:
-1
result:
ok single line: '-1'
Test #68:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
11395519
output:
-1
result:
ok single line: '-1'
Test #69:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
770111437
output:
-1
result:
ok single line: '-1'
Test #70:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
283702
output:
-1
result:
ok single line: '-1'
Test #71:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
9111
output:
-1
result:
ok single line: '-1'
Test #72:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
1
output:
1
result:
ok single line: '1'
Test #73:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
652579
output:
-1
result:
ok single line: '-1'
Test #74:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
866
output:
-1
result:
ok single line: '-1'
Test #75:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
7422
output:
-1
result:
ok single line: '-1'
Test #76:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
41901
output:
-1
result:
ok single line: '-1'
Test #77:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
98421265
output:
-1
result:
ok single line: '-1'
Test #78:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
12
output:
2
result:
ok single line: '2'
Test #79:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
8294546
output:
-1
result:
ok single line: '-1'
Test #80:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
564964198
output:
-1
result:
ok single line: '-1'
Test #81:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
5307
output:
-1
result:
ok single line: '-1'
Test #82:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
89
output:
-1
result:
ok single line: '-1'
Test #83:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
9790501
output:
-1
result:
ok single line: '-1'
Test #84:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
4094
output:
-1
result:
ok single line: '-1'
Test #85:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
183
output:
-1
result:
ok single line: '-1'
Test #86:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
46295692
output:
-1
result:
ok single line: '-1'
Test #87:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
62748918
output:
-1
result:
ok single line: '-1'
Test #88:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
13245
output:
-1
result:
ok single line: '-1'
Test #89:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
8101
output:
-1
result:
ok single line: '-1'
Test #90:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
4704081
output:
-1
result:
ok single line: '-1'
Test #91:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
370623466
output:
-1
result:
ok single line: '-1'
Test #92:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
367719186
output:
-1
result:
ok single line: '-1'
Test #93:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
6998274
output:
-1
result:
ok single line: '-1'
Test #94:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
85123
output:
-1
result:
ok single line: '-1'
Test #95:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
8956409
output:
-1
result:
ok single line: '-1'
Test #96:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
86
output:
-1
result:
ok single line: '-1'