Submission #364220

# Submission time Handle Problem Language Result Execution time Memory
364220 2021-02-08T12:40:02 Z Ahmadsm2005 Costinland (info1cup19_costinland) C++14
11.9757 / 100
500 ms 332 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,Z=7;
    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 time Memory Grader output
1 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
2 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
3 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
4 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
5 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
6 Partially correct 2 ms 332 KB Partially Correct! Your size: 7
7 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
8 Partially correct 2 ms 332 KB Partially Correct! Your size: 7
9 Partially correct 1 ms 332 KB Partially Correct! Your size: 7
# Verdict Execution time Memory Grader output
1 Execution timed out 1055 ms 332 KB Time limit exceeded
2 Halted 0 ms 0 KB -