Submission #1009181

# Submission time Handle Problem Language Result Execution time Memory
1009181 2024-06-27T09:44:54 Z giorgi123glm Costinland (info1cup19_costinland) C++17
0 / 100
0 ms 456 KB
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main () {
    #ifndef CPH
    ios::sync_with_stdio (false);
    cin.tie (0);
    cout.tie (0);
    #endif

    long long k = 0;
    cin >> k;

    int Xos = 0;
    for (int i = 63; i >= 0; i--)
        if ((k & (1ll << i))) {
            Xos = i;
            break;
        }
    
    int n = max (Xos + 1, 5);
    vector <vector <char> > gr (n, vector <char> (n, '.')); 
    for (int i = 0; i < Xos; i++)
        gr[i][i] = 'X';
    
    for (int i = 0; i < n - 1; i++) {
        gr[i + 1][i] = 'r';
        for (int y = i + 2; y < n; y++)
            gr[y][i] = 'd';
        gr[i][i + 1] = 'd';
        for (int x = i + 2; x < n; x++)
            gr[i][x] = 'r';
    }

    for (int i = 0; i < n - 1; i++) {
        gr[n - 1][i] = 'r';
        gr[i][n - 1] = 'd';
    }

    for (int i = 1; i < Xos; i++)
        if ((k & (1 << i))) {
            gr[i][i - 1] = 'X';
            gr[i - 1][i] = 'X';
        }
    
    if ((k & 1))
        gr[0][n - 2] = 'X';

    for (int y = 0; y < n; y++) {
        for (int x = 0; x < n; x++)
            cout << gr[y][x];
        cout << '\n';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Expected integer, but "XdrXd" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 456 KB Expected integer, but "XdrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrXd" found
2 Halted 0 ms 0 KB -