Submission #795790

# Submission time Handle Problem Language Result Execution time Memory
795790 2023-07-27T15:10:00 Z Andrey Costinland (info1cup19_costinland) C++14
0 / 100
1 ms 212 KB
#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout.tie(NULL);
    long long k,br = 2,y = 1;
    cin >> k;
    while(2*y < k) {
        y*=2;
        br++;
    }
    char ans[br][br];
    for(long long i = 0; i < br; i++) {
        for(long long j = 0; j < br; j++) {
            ans[i][j] = '.';
        }
    }
    for(long long i = 1; i < br-1; i++) {
        ans[i][i] = 'X';
        ans[i][i+1] = 'd';
        ans[i+1][i] = 'r';
    }
    for(long long i = 0; i < br-1; i++) {
        ans[br-1][i] = 'r';
        ans[i][br-1] = 'd';
    }
    ans[0][0] = 'r';
    for(long long i = 1; i < br-1; i++) {
        y = (1 << (br-i-1));
        if(y&k) {
            if(k%y == 0) {
                ans[0][i] = 'd';
            }
            else {
                ans[0][i] = 'X';
            }
        }
    }
    for(long long i = 0; i < br; i++) {
        for(long long j = 0; j < br; j++) {
            cout << ans[i][j];
        }
        cout << "\n";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "rXd" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Expected integer, but "r....XXXX......XXX.X..X.XX.dX...X....XXXX......XXX.X..X.XX.d" found
2 Halted 0 ms 0 KB -