#include <bits/stdc++.h>
using namespace std;
int encode (int n, int x, int y) {
if(x>n)x=0;
if(y>n)y=0;
string s;
string f=to_string(x);
while(f.size()<3)f="0"+f;
s+=f;
f=to_string(y);
while(f.size()<3)f="0"+f;
s+=f;
return stoi(s);
}
#include <bits/stdc++.h>
using namespace std;
int decode (int n, int q, int h) {
string s=to_string(h);
int a=0;
for(int i=0;i<3;i++){
a+=(s.back()-'0')*ceil(pow(10,i));
s.pop_back();
}
int b=stoi(s);
if(q==b)return 1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3328 ms |
24184 KB |
Integer 920919 violates the range [1, 1000] |
2 |
Incorrect |
3229 ms |
24228 KB |
Integer 920919 violates the range [1, 1000] |