Submission #314600

# Submission time Handle Problem Language Result Execution time Memory
314600 2020-10-20T12:38:44 Z balbit Costinland (info1cup19_costinland) C++14
0 / 100
1 ms 204 KB
#include <bits/stdc++.h>
using namespace std;
#ifndef BALBIT
//#include "grader.h"
#endif
#define ll long long
#define pii pair<int, int>
#define f first
#define s second

#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x.size())
#define pb push_back

#ifdef BALBIT
#define bug(...) cerr<<"#"<<__LINE__<<": "<<#__VA_ARGS__<<"- ", _do(__VA_ARGS__)
template<typename T> void _do(T && x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T && x, S && ...y){cerr<<x<<", "; _do(y...);}
#else
#define endl '\n'
#define bug(...)
#endif
#define IOS() ios::sync_with_stdio(0)


//#ifdef BALBIT
const int maxn = 70;
char g[maxn][maxn];
ll C[maxn][maxn];

void build(){
    for (int i = 0; i<maxn; ++i) {
        for (int j = 0; j<maxn; ++j) {
            if (j > i) continue;
            if (!i || !j) {
                C[i][j] = 1;
            }else{
                C[i][j] = C[i-1][j-1] + C[i-1][j];
            }
        }
    }
}

signed main(){ IOS();
    bug(1,2);
//    build();
    int n; cin>>n; n-=2;
    memset(g, '.', sizeof g);
    int m = 63;
    bug(m);
    for (int i = 1; i<=m; ++i) {
        for (int j = 1; j<=m; ++j) {
            if (i + j <= m) {
                g[i][j] = 'X';
            }
        }
    }
    if ((1<<m) - 1 <= n) {
        for (int i = 1; i<=m; ++i) {
            g[i][0] = 'X';
        }
        n -= (1<<m) - 1;
    }
    g[0][0] = 'X';
    for (int j = 1; j<=m; ++j) {
        if (n >= (1<<(m-j))) {
            g[0][j] = 'X'; n -= (1<<(m-j));
        }else{
            g[0][j] = 'r';
        }
    }
    bug(n);
    cout<<m+2<<' '<<m+2<<endl;
    for (int i = 0; i<=m+1; ++i) {
        for (int j = 0; j<=m+1; ++j) {
            if( i == m+1 && j == m+1) {
                cout<<'.';
            }
            else{
                if (i == m+1) cout<<'r';
                else if (j == m+1) cout<<'d';
                else{
                    cout<<g[i][j];
                }
            }
            if (j == m+1) cout<<'\n';
        }
    }
}

//#endif // BALBIT

/*
4
6
2 6 4 3 1 5
10
4 9 6 3 1 10 8 5 2 7
4
4 1 3 2
10
7 8 9 10 5 6 1 2 3 4
*/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB The matrix does not generate the required number of Costins
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB The matrix does not generate the required number of Costins
2 Halted 0 ms 0 KB -