#include <bits/stdc++.h>
//#define endl '\n'
#define modulo 1000000007
//#define int long long
#define PI acos(-1)
#pragma GCC optimize("-Ofast")
//#pragma GCC optimize("trapv")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
#define asinDegrees(x) asin(x)* 180.0 / PI
#define EPS 0.000000001
using namespace std;
int power(int x,int y,int m)
{
int temp;
if(y == 0)
return 1;
temp = (power(x, y/2,m))%m;
if (y%2 == 0)
return ((temp%m)*temp);
else
return ((x*temp%m)*temp%m)%m;
}
int inv(int x,int m=modulo)
{
return (power(x,m-2,m))%m;
}
///IOI 2021 isA
int X,Y,Z=100;
vector<vector<char>>FOUND;
void BEST(vector<vector<char>>lolz,vector<vector<int>>lolz2,int x,int y){
if(x<0)
x=Z-2,y--;
if(y<0){
if(lolz2[0][0]==X&&!FOUND.size()){
for(int i=0;i<Z-1;i++){
for(int l=0;l<Z-1;l++)
cout<<lolz[i][l];
cout<<'d'<<endl;
}
for(int i=0;i<Z-1;i++)
cout<<'r';
cout<<'.';
exit(0);
}
return;
}
if(rand()%2){
lolz[x][y]='X';
lolz2[x][y]=lolz2[x+1][y]+lolz2[x][y+1];
BEST(lolz,lolz2,x-1,y);
lolz[x][y]='d';
lolz2[x][y]=lolz2[x+1][y];
BEST(lolz,lolz2,x-1,y);
}
else{
lolz[x][y]='d';
lolz2[x][y]=lolz2[x+1][y];
BEST(lolz,lolz2,x-1,y);
lolz[x][y]='X';
lolz2[x][y]=lolz2[x+1][y]+lolz2[x][y+1];
BEST(lolz,lolz2,x-1,y);
}
}
int32_t main()
{
//freopen("output.txt","w",stdout);
//freopen("sorting.in","r",stdin);
cin.tie(0),iostream::sync_with_stdio(0);
cin>>X;
if(X<20)
Z=5;
vector<vector<char>>lolz(Z-1);
vector<vector<int>>lolz2(Z);
for(int i=0;i<Z-1;i++){
for(int l=0;l<Z-1;l++){
lolz[i].push_back('.');
}
}
for(int i=0;i<Z;i++){
for(int l=0;l<Z;l++)
lolz2[i].push_back(1);
}
cout<<Z<<' '<<Z<<endl;
//CALC(0,0);
BEST(lolz,lolz2,Z-2,Z-2);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Correct! Your size: 5 |
2 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
3 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
4 |
Correct |
2 ms |
204 KB |
Correct! Your size: 5 |
5 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
6 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
7 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
8 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
9 |
Correct |
1 ms |
204 KB |
Correct! Your size: 5 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
49 ms |
65540 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |