답안 #364200

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
364200 2021-02-08T11:34:09 Z Ahmadsm2005 Costinland (info1cup19_costinland) C++14
20 / 100
500 ms 204 KB
#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;
vector<vector<char>>FOUND;
void BEST(vector<vector<char>>lolz,vector<vector<int>>lolz2,int x,int y){
if(x<0)
x=3,y--;
if(y<0){
if(lolz2[0][0]==X&&!FOUND.size()){
for(int i=0;i<4;i++){
for(int l=0;l<4;l++)
cout<<lolz[i][l];
cout<<'d'<<endl;
}
for(int i=0;i<4;i++)
cout<<'r';
cout<<'.';
exit(0);
}
return;
}
lolz[x][y]='d';
lolz2[x][y]=lolz2[x+1][y];
BEST(lolz,lolz2,x-1,y);
lolz[x][y]='r';
lolz2[x][y]=lolz2[x][y+1];
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(4);
vector<vector<int>>lolz2(5);
for(int i=0;i<4;i++){
for(int l=0;l<4;l++){
lolz[i].push_back('.');
}
}
for(int i=0;i<5;i++){
for(int l=0;l<5;l++)
lolz2[i].push_back(1);
}
cout<<5<<' '<<5<<endl;
//CALC(0,0);
BEST(lolz,lolz2,3,3);
return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 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 1 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 2 ms 204 KB Correct! Your size: 5
8 Correct 5 ms 204 KB Correct! Your size: 5
9 Correct 28 ms 204 KB Correct! Your size: 5
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1083 ms 204 KB Time limit exceeded
2 Halted 0 ms 0 KB -