Submission #364221

#TimeUsernameProblemLanguageResultExecution timeMemory
364221Ahmadsm2005Costinland (info1cup19_costinland)C++14
0 / 100
1100 ms464 KiB
#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=11; 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; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...