# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
572601 |
2022-06-04T18:58:39 Z |
oleh1421 |
Mars (APIO22_mars) |
C++17 |
|
1335 ms |
4892 KB |
#include "mars.h"
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
const int N=42;
vector<int>decrypt(string s,int sz,string t){
vector<int>ans;
vector<int>st;
int cnt=0;
for (int i=0;i<100 && ans.size()<sz;i+=2){
if (s[i]=='0' && s[i+1]=='0') break;
else if (s[i]=='1' && s[i+1]=='0'){
cnt++;
st.push_back(cnt);
ans.push_back(cnt);
} else if (s[i]=='1' && s[i+1]=='1'){
ans.push_back(st.back());
} else if (s[i]=='0' && s[i+1]=='1'){
st.pop_back();
}
}
vector<int>rl(t.size(),0);
int ind=0;
for (int i=0;i<t.size();i++){
if (t[i]=='1'){
int j=i;
while (j+1<t.size() && t[j+1]=='1') j++;
while (i<=j){
rl[i++]=ans[ind];
}
ind++;
i=i-1;
}
}
return rl;
}
int dsu[N][N];
int CNT=0;
const int Lg=11;
int go[N*N];
bool used[N*N];
int get(int x){
if (!x) return 0;
if (go[x]==x) return x;
return go[x]=get(go[x]);
}
void unite(int x,int y){
x=get(x);
y=get(y);
if (x!=y){
CNT--;
go[x]=y;
}
}
string process(vector<vector<string>> a, int i, int j, int k, int n)
{
// cout<<i<<" "<<j<<" "<<k<<" "<<n<<endl;
k*=2;
n=2*n;
if (i+k+2==n && j+k+2==n){
if (k==0){
memset(dsu,0,sizeof(dsu));
int mx=0;
for (int x=0;x<3;x++){
for (int y=0;y<3;y++){
if (a[x][y][0]=='1') dsu[i+x][j+y]=++mx;
}
}
for (int i=1;i<=mx;i++) go[i]=i,used[i]=false;
CNT=mx;
for (int i=0;i<Lg;i++){
if (a[2][2][100-i-1]=='1') CNT+=(1<<i);
}
for (int x=i;x<=n;x++){
for (int y=j;y<=n;y++){
for (int dx=-1;dx<=1;dx++){
for (int dy=-1;dy<=1;dy++){
if (!dx && !dy) continue;
if (dx && dy) continue;
int nx=x+dx;
int ny=y+dy;
if (!dsu[x][y]) continue;
if (!dsu[nx][ny]) continue;
unite(dsu[x][y],dsu[nx][ny]);
}
}
}
}
string ans="";
if (k<n-2){
vector<int>message;
for (int x=n;x>=i;x--){
message.push_back(get(dsu[x][j]));
}
for (int y=j+1;y<=n;y++){
message.push_back(get(dsu[i][y]));
}
vector<int>nw;
for (int i=0;i<message.size();i++){
if (!message[i]) continue;
if (i==0 || message[i]!=message[i-1]) nw.push_back(message[i]);
}
message=nw;
// cerr<<"OOOOOO"<<endl;
vector<int>st;
for (int i:message){
if (!used[i]){
used[i]=true;
ans+="10";
st.push_back(i);
} else {
while (st.back()!=i){
ans+="01";
st.pop_back();
}
ans+="11";
// st.push_back(i);
}
}
if (ans.size()+Lg>100){
while (true){
ans+="0";
}
}
while (ans.size()<100) ans+="0";
for (int i=0;i<Lg;i++){
if (CNT&(1<<i)){
ans[100-i-1]='1';
}
}
} else {
for (int i=0;i<100;i++) ans+="0";
for (int i=0;i<Lg;i++){
if (CNT&(1<<i)) ans[i]='1';
}
}
// cout<<"AAAAAAAA "<<ans.size()<<endl;
return ans;
} else {
memset(dsu,0,sizeof(dsu));
string s="";
for (int x=n;x>=i+2;x--){
s+=a[2][1][n+(x-i-2)];
}
for (int y=j+3;y<=n;y++){
s+=a[1][2][n+y-j-2];
}
// cout<<s<<endl;
vector<int>v=decrypt(a[2][2],2*k+1,s);
// cout<<a[2][2]<<endl;
// cout<<"V "<<2*k+1<<" ";
// for (int i:v) cout<<i<<" ";
// cout<<endl;
int mx=0;
for (int i:v) mx=max(mx,i);
int last=mx;
for (int x=n;x>=j+2;x--){
dsu[i+2][x]=v.back();
v.pop_back();
}
for (int y=i+3;y<=n;y++){
dsu[y][j+2]=v.back();
v.pop_back();
}
if (a[0][0][0]=='1') dsu[i][j]=(++mx);
if (a[0][1][0]=='1') dsu[i][j+1]=(++mx);
if (a[1][0][0]=='1') dsu[i+1][j]=(++mx);
if (a[1][1][0]=='1') dsu[i+1][j+1]=(++mx);
for (int x=i+2;x<=n;x++){
if (a[2][0][x-i-2]=='1') dsu[x][j]=(++mx);
}
for (int x=i+2;x<=n;x++){
if (a[2][1][x-i-2]=='1') dsu[x][j+1]=(++mx);
}
for (int x=j+2;x<=n;x++){
if (a[0][2][x-i-2]=='1') dsu[i][x]=(++mx);
}
for (int x=j+2;x<=n;x++){
if (a[1][2][x-i-2]=='1') dsu[i+1][x]=(++mx);
}
for (int i=1;i<=mx;i++) go[i]=i,used[i]=false;
CNT=mx-last;
for (int x=0;x<Lg;x++){
if (a[2][2][100-x-1]=='1') CNT+=(1<<x);
}
// cerr<<"OOOOOO"<<endl;
// for (int x=0;x<=n;x++){
// for (int y=0;y<=n;y++){
// cout<<dsu[x][y]<<" ";
// }
// cout<<endl;
// }
for (int x=i;x<=n;x++){
for (int y=j;y<=n;y++){
for (int dx=-1;dx<=1;dx++){
for (int dy=-1;dy<=1;dy++){
if (!dx && !dy) continue;
if (dx && dy) continue;
int nx=x+dx;
int ny=y+dy;
if (nx<0 || nx>n || ny<0 || ny>n) continue;
if (!dsu[x][y]) continue;
if (!dsu[nx][ny]) continue;
// cout<<x<<" "<<y<<" "<<nx<<" "<<ny<<" "<<dsu[x][y]<<" "<<dsu[nx][ny]<<endl;
unite(dsu[x][y],dsu[nx][ny]);
}
}
}
}
// cerr<<"OOOOOO"<<endl;
vector<int>message;
for (int x=n;x>=i;x--){
message.push_back(get(dsu[x][j]));
}
for (int y=j+1;y<=n;y++){
message.push_back(get(dsu[i][y]));
}
vector<int>nw;
for (int i=0;i<message.size();i++){
if (!message[i]) continue;
if (i==0 || message[i]!=message[i-1]) nw.push_back(message[i]);
}
message=nw;
string ans="";
if (k<n-2){
// cerr<<"OOOOOO"<<endl;
vector<int>st;
for (int i:message){
if (!used[i]){
used[i]=true;
ans+="10";
st.push_back(i);
} else {
while (st.back()!=i){
ans+="01";
st.pop_back();
}
ans+="11";
// st.push_back(i);
}
}
// if (ans.size()+Lg>100){
// while (true){
// ans+="0";
// }
// }
while (ans.size()<100) ans+="0";
for (int i=0;i<Lg;i++){
if (CNT&(1<<i)){
ans[100-i-1]='1';
}
}
} else {
for (int i=0;i<100;i++) ans+="0";
for (int i=0;i<Lg;i++){
if (CNT&(1<<i)) ans[i]='1';
}
}
return ans;
}
} else if (i+k+2==n){
string ans="";
for (int i=0;i<100;i++) ans+="0";
ans[0]=a[0][0][0];
ans[1]=a[1][0][0];
for (int i=2;i<100;i++) ans[i]=a[2][0][i-2];
ans[n]=a[0][1][0];
ans[n+1]=a[1][1][0];
for (int i=n+2;i<n*2;i++) ans[i]=a[2][1][i-n-2];
return ans;
} else if (j+k+2==n){
string ans="";
for (int i=0;i<100;i++) ans+="0";
ans[0]=a[0][0][0];
ans[1]=a[0][1][0];
for (int i=2;i<n;i++) ans[i]=a[0][2][i-2];
ans[n]=a[1][0][0];
ans[n+1]=a[1][1][0];
for (int i=n+2;i<n*2;i++) ans[i]=a[1][2][i-n-2];
return ans;
} else {
return a[0][0];
}
}
/**
1
2
1 1 0 1 1
1 1 0 0 0
1 0 1 1 1
0 1 0 0 0
0 1 1 1 1
1
3
1 0 1 1 1 0 0
0 0 1 0 1 0 0
1 1 1 0 1 0 0
1 0 0 0 1 0 0
0 1 1 0 1 0 1
0 0 0 0 0 0 1
0 0 0 0 1 1 1
4
**/
Compilation message
mars.cpp: In function 'std::vector<int> decrypt(std::string, int, std::string)':
mars.cpp:10:37: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
10 | for (int i=0;i<100 && ans.size()<sz;i+=2){
| ~~~~~~~~~~^~~
mars.cpp:24:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
24 | for (int i=0;i<t.size();i++){
| ~^~~~~~~~~
mars.cpp:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
27 | while (j+1<t.size() && t[j+1]=='1') j++;
| ~~~^~~~~~~~~
mars.cpp: In function 'std::string process(std::vector<std::vector<std::__cxx11::basic_string<char> > >, int, int, int, int)':
mars.cpp:103:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
103 | for (int i=0;i<message.size();i++){
| ~^~~~~~~~~~~~~~~
mars.cpp:232:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
232 | for (int i=0;i<message.size();i++){
| ~^~~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
37 |
Correct |
251 ms |
3148 KB |
Output is correct |
38 |
Correct |
326 ms |
3324 KB |
Output is correct |
39 |
Correct |
301 ms |
3380 KB |
Output is correct |
40 |
Correct |
308 ms |
3388 KB |
Output is correct |
41 |
Correct |
325 ms |
3268 KB |
Output is correct |
42 |
Correct |
309 ms |
3332 KB |
Output is correct |
43 |
Correct |
289 ms |
3440 KB |
Output is correct |
44 |
Correct |
281 ms |
3300 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
37 |
Correct |
251 ms |
3148 KB |
Output is correct |
38 |
Correct |
326 ms |
3324 KB |
Output is correct |
39 |
Correct |
301 ms |
3380 KB |
Output is correct |
40 |
Correct |
308 ms |
3388 KB |
Output is correct |
41 |
Correct |
325 ms |
3268 KB |
Output is correct |
42 |
Correct |
309 ms |
3332 KB |
Output is correct |
43 |
Correct |
289 ms |
3440 KB |
Output is correct |
44 |
Correct |
281 ms |
3300 KB |
Output is correct |
45 |
Correct |
363 ms |
3436 KB |
Output is correct |
46 |
Correct |
452 ms |
3448 KB |
Output is correct |
47 |
Correct |
470 ms |
3624 KB |
Output is correct |
48 |
Correct |
461 ms |
3528 KB |
Output is correct |
49 |
Correct |
461 ms |
3428 KB |
Output is correct |
50 |
Correct |
471 ms |
3592 KB |
Output is correct |
51 |
Correct |
449 ms |
3428 KB |
Output is correct |
52 |
Correct |
449 ms |
3480 KB |
Output is correct |
53 |
Correct |
447 ms |
3568 KB |
Output is correct |
54 |
Correct |
466 ms |
3712 KB |
Output is correct |
55 |
Correct |
455 ms |
3492 KB |
Output is correct |
56 |
Correct |
458 ms |
3428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
37 |
Correct |
251 ms |
3148 KB |
Output is correct |
38 |
Correct |
326 ms |
3324 KB |
Output is correct |
39 |
Correct |
301 ms |
3380 KB |
Output is correct |
40 |
Correct |
308 ms |
3388 KB |
Output is correct |
41 |
Correct |
325 ms |
3268 KB |
Output is correct |
42 |
Correct |
309 ms |
3332 KB |
Output is correct |
43 |
Correct |
289 ms |
3440 KB |
Output is correct |
44 |
Correct |
281 ms |
3300 KB |
Output is correct |
45 |
Correct |
363 ms |
3436 KB |
Output is correct |
46 |
Correct |
452 ms |
3448 KB |
Output is correct |
47 |
Correct |
470 ms |
3624 KB |
Output is correct |
48 |
Correct |
461 ms |
3528 KB |
Output is correct |
49 |
Correct |
461 ms |
3428 KB |
Output is correct |
50 |
Correct |
471 ms |
3592 KB |
Output is correct |
51 |
Correct |
449 ms |
3428 KB |
Output is correct |
52 |
Correct |
449 ms |
3480 KB |
Output is correct |
53 |
Correct |
447 ms |
3568 KB |
Output is correct |
54 |
Correct |
466 ms |
3712 KB |
Output is correct |
55 |
Correct |
455 ms |
3492 KB |
Output is correct |
56 |
Correct |
458 ms |
3428 KB |
Output is correct |
57 |
Correct |
566 ms |
4032 KB |
Output is correct |
58 |
Correct |
684 ms |
4228 KB |
Output is correct |
59 |
Correct |
655 ms |
4220 KB |
Output is correct |
60 |
Correct |
667 ms |
4148 KB |
Output is correct |
61 |
Correct |
687 ms |
4096 KB |
Output is correct |
62 |
Correct |
674 ms |
4108 KB |
Output is correct |
63 |
Correct |
681 ms |
4224 KB |
Output is correct |
64 |
Correct |
673 ms |
4232 KB |
Output is correct |
65 |
Correct |
680 ms |
4308 KB |
Output is correct |
66 |
Correct |
675 ms |
4104 KB |
Output is correct |
67 |
Correct |
674 ms |
4212 KB |
Output is correct |
68 |
Correct |
706 ms |
4264 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
37 |
Correct |
251 ms |
3148 KB |
Output is correct |
38 |
Correct |
326 ms |
3324 KB |
Output is correct |
39 |
Correct |
301 ms |
3380 KB |
Output is correct |
40 |
Correct |
308 ms |
3388 KB |
Output is correct |
41 |
Correct |
325 ms |
3268 KB |
Output is correct |
42 |
Correct |
309 ms |
3332 KB |
Output is correct |
43 |
Correct |
289 ms |
3440 KB |
Output is correct |
44 |
Correct |
281 ms |
3300 KB |
Output is correct |
45 |
Correct |
363 ms |
3436 KB |
Output is correct |
46 |
Correct |
452 ms |
3448 KB |
Output is correct |
47 |
Correct |
470 ms |
3624 KB |
Output is correct |
48 |
Correct |
461 ms |
3528 KB |
Output is correct |
49 |
Correct |
461 ms |
3428 KB |
Output is correct |
50 |
Correct |
471 ms |
3592 KB |
Output is correct |
51 |
Correct |
449 ms |
3428 KB |
Output is correct |
52 |
Correct |
449 ms |
3480 KB |
Output is correct |
53 |
Correct |
447 ms |
3568 KB |
Output is correct |
54 |
Correct |
466 ms |
3712 KB |
Output is correct |
55 |
Correct |
455 ms |
3492 KB |
Output is correct |
56 |
Correct |
458 ms |
3428 KB |
Output is correct |
57 |
Correct |
566 ms |
4032 KB |
Output is correct |
58 |
Correct |
684 ms |
4228 KB |
Output is correct |
59 |
Correct |
655 ms |
4220 KB |
Output is correct |
60 |
Correct |
667 ms |
4148 KB |
Output is correct |
61 |
Correct |
687 ms |
4096 KB |
Output is correct |
62 |
Correct |
674 ms |
4108 KB |
Output is correct |
63 |
Correct |
681 ms |
4224 KB |
Output is correct |
64 |
Correct |
673 ms |
4232 KB |
Output is correct |
65 |
Correct |
680 ms |
4308 KB |
Output is correct |
66 |
Correct |
675 ms |
4104 KB |
Output is correct |
67 |
Correct |
674 ms |
4212 KB |
Output is correct |
68 |
Correct |
706 ms |
4264 KB |
Output is correct |
69 |
Correct |
817 ms |
4176 KB |
Output is correct |
70 |
Correct |
940 ms |
4284 KB |
Output is correct |
71 |
Correct |
933 ms |
4312 KB |
Output is correct |
72 |
Correct |
970 ms |
4504 KB |
Output is correct |
73 |
Correct |
948 ms |
4460 KB |
Output is correct |
74 |
Correct |
920 ms |
4412 KB |
Output is correct |
75 |
Correct |
966 ms |
4348 KB |
Output is correct |
76 |
Correct |
921 ms |
4296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
2248 KB |
Output is correct |
2 |
Correct |
8 ms |
2364 KB |
Output is correct |
3 |
Correct |
8 ms |
2260 KB |
Output is correct |
4 |
Correct |
8 ms |
1984 KB |
Output is correct |
5 |
Correct |
8 ms |
2176 KB |
Output is correct |
6 |
Correct |
8 ms |
2236 KB |
Output is correct |
7 |
Correct |
12 ms |
2256 KB |
Output is correct |
8 |
Correct |
16 ms |
2240 KB |
Output is correct |
9 |
Correct |
17 ms |
2460 KB |
Output is correct |
10 |
Correct |
17 ms |
2136 KB |
Output is correct |
11 |
Correct |
16 ms |
2380 KB |
Output is correct |
12 |
Correct |
16 ms |
2448 KB |
Output is correct |
13 |
Correct |
18 ms |
2536 KB |
Output is correct |
14 |
Correct |
34 ms |
2656 KB |
Output is correct |
15 |
Correct |
42 ms |
2656 KB |
Output is correct |
16 |
Correct |
46 ms |
2704 KB |
Output is correct |
17 |
Correct |
45 ms |
2676 KB |
Output is correct |
18 |
Correct |
47 ms |
2688 KB |
Output is correct |
19 |
Correct |
47 ms |
2664 KB |
Output is correct |
20 |
Correct |
47 ms |
2716 KB |
Output is correct |
21 |
Correct |
67 ms |
2644 KB |
Output is correct |
22 |
Correct |
98 ms |
2744 KB |
Output is correct |
23 |
Correct |
90 ms |
2804 KB |
Output is correct |
24 |
Correct |
103 ms |
2788 KB |
Output is correct |
25 |
Correct |
98 ms |
2816 KB |
Output is correct |
26 |
Correct |
103 ms |
2728 KB |
Output is correct |
27 |
Correct |
98 ms |
2724 KB |
Output is correct |
28 |
Correct |
88 ms |
2744 KB |
Output is correct |
29 |
Correct |
139 ms |
2844 KB |
Output is correct |
30 |
Correct |
179 ms |
2928 KB |
Output is correct |
31 |
Correct |
186 ms |
2908 KB |
Output is correct |
32 |
Correct |
191 ms |
2960 KB |
Output is correct |
33 |
Correct |
193 ms |
2988 KB |
Output is correct |
34 |
Correct |
194 ms |
2960 KB |
Output is correct |
35 |
Correct |
201 ms |
3000 KB |
Output is correct |
36 |
Correct |
194 ms |
2948 KB |
Output is correct |
37 |
Correct |
251 ms |
3148 KB |
Output is correct |
38 |
Correct |
326 ms |
3324 KB |
Output is correct |
39 |
Correct |
301 ms |
3380 KB |
Output is correct |
40 |
Correct |
308 ms |
3388 KB |
Output is correct |
41 |
Correct |
325 ms |
3268 KB |
Output is correct |
42 |
Correct |
309 ms |
3332 KB |
Output is correct |
43 |
Correct |
289 ms |
3440 KB |
Output is correct |
44 |
Correct |
281 ms |
3300 KB |
Output is correct |
45 |
Correct |
363 ms |
3436 KB |
Output is correct |
46 |
Correct |
452 ms |
3448 KB |
Output is correct |
47 |
Correct |
470 ms |
3624 KB |
Output is correct |
48 |
Correct |
461 ms |
3528 KB |
Output is correct |
49 |
Correct |
461 ms |
3428 KB |
Output is correct |
50 |
Correct |
471 ms |
3592 KB |
Output is correct |
51 |
Correct |
449 ms |
3428 KB |
Output is correct |
52 |
Correct |
449 ms |
3480 KB |
Output is correct |
53 |
Correct |
447 ms |
3568 KB |
Output is correct |
54 |
Correct |
466 ms |
3712 KB |
Output is correct |
55 |
Correct |
455 ms |
3492 KB |
Output is correct |
56 |
Correct |
458 ms |
3428 KB |
Output is correct |
57 |
Correct |
566 ms |
4032 KB |
Output is correct |
58 |
Correct |
684 ms |
4228 KB |
Output is correct |
59 |
Correct |
655 ms |
4220 KB |
Output is correct |
60 |
Correct |
667 ms |
4148 KB |
Output is correct |
61 |
Correct |
687 ms |
4096 KB |
Output is correct |
62 |
Correct |
674 ms |
4108 KB |
Output is correct |
63 |
Correct |
681 ms |
4224 KB |
Output is correct |
64 |
Correct |
673 ms |
4232 KB |
Output is correct |
65 |
Correct |
680 ms |
4308 KB |
Output is correct |
66 |
Correct |
675 ms |
4104 KB |
Output is correct |
67 |
Correct |
674 ms |
4212 KB |
Output is correct |
68 |
Correct |
706 ms |
4264 KB |
Output is correct |
69 |
Correct |
817 ms |
4176 KB |
Output is correct |
70 |
Correct |
940 ms |
4284 KB |
Output is correct |
71 |
Correct |
933 ms |
4312 KB |
Output is correct |
72 |
Correct |
970 ms |
4504 KB |
Output is correct |
73 |
Correct |
948 ms |
4460 KB |
Output is correct |
74 |
Correct |
920 ms |
4412 KB |
Output is correct |
75 |
Correct |
966 ms |
4348 KB |
Output is correct |
76 |
Correct |
921 ms |
4296 KB |
Output is correct |
77 |
Correct |
954 ms |
4444 KB |
Output is correct |
78 |
Correct |
1309 ms |
4688 KB |
Output is correct |
79 |
Correct |
1277 ms |
4892 KB |
Output is correct |
80 |
Correct |
1302 ms |
4804 KB |
Output is correct |
81 |
Correct |
1313 ms |
4712 KB |
Output is correct |
82 |
Correct |
1335 ms |
4868 KB |
Output is correct |
83 |
Correct |
1303 ms |
4648 KB |
Output is correct |
84 |
Correct |
1331 ms |
4756 KB |
Output is correct |