답안 #738320

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
738320 2023-05-08T13:08:26 Z sandry24 Costinland (info1cup19_costinland) C++17
0 / 100
0 ms 212 KB
#include <bits/stdc++.h>
//#include "grader.h"
using namespace std;
 
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second

int get_log(int k){
    int cnt = 0;
    while(k > 0){
        cnt++;
        k /= 2;
    }
    return cnt;
}
 
void solve(){
    int k;
    cin >> k;
    int n = get_log(k);
    vector<vector<char>> a(n, vector<char>(n, '.'));
    for(int i = 0; i < n-1; i++){
        a[i][i] = 'X';
        a[i+1][i] = ((1 << i) & k ? 'X' : 'r');
        a[i][i+1] = 'd';
        a[n-1][i] = 'r';
        a[i][n-1] = 'd';
    }
    a[n-1][n-1] = '.';
    cout << n << ' ' << n << '\n';
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++)
            cout << a[i][j];
        cout << '\n';
    }
}

int main(){
    //freopen("input.txt", "r", stdin);
    //freopen("test.out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB The matrix does not generate the required number of Costins
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB The matrix does not generate the required number of Costins
2 Halted 0 ms 0 KB -