Submission #314606

# Submission time Handle Problem Language Result Execution time Memory
314606 2020-10-20T12:41:36 Z balbit Costinland (info1cup19_costinland) C++14
58.5058 / 100
2 ms 332 KB
#include <bits/stdc++.h>
using namespace std;
#ifndef BALBIT
//#include "grader.h"
#endif
#define ll long long
#define int ll
#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 = 61;
    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 ((1ll<<m) - 1 <= n) {
        for (int i = 1; i<=m; ++i) {
            g[i][0] = 'X';
        }
        n -= (1ll<<m) - 1;
    }
    g[0][0] = 'X';
    for (int j = 1; j<=m; ++j) {
        if (n >= (1ll<<(m-j))) {
            g[0][j] = 'X'; n -= (1ll<<(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 Partially correct 2 ms 332 KB Partially Correct! Your size: 63
2 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
3 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
4 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
5 Partially correct 1 ms 332 KB Partially Correct! Your size: 63
6 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
7 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
8 Partially correct 1 ms 332 KB Partially Correct! Your size: 63
9 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
2 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
3 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
4 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
5 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
6 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
7 Partially correct 1 ms 204 KB Partially Correct! Your size: 63
8 Partially correct 2 ms 204 KB Partially Correct! Your size: 63