Submission #1151929

#TimeUsernameProblemLanguageResultExecution timeMemory
1151929asdasdCostinland (info1cup19_costinland)C++20
20 / 100
0 ms328 KiB
//gm  --- akezhon
#include <bits/stdc++.h>
// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define pb push_back
#define pf push_front
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define pii pair<int,int>
#define tm (tl+tr)/2
#define TL v+v, tl, tm
#define TR v+v+1, tm+1, tr
#define DA l <= tl && tr <= r
#define NE r < tl || tr < l
#define double long double
#define int long long
using namespace std;

const int N=2e5+7;
const int mod=998244353;
const int inf=2e18;

char c[100][100];
int a[100][100];

void AlemAmenov(){
    int k;
    cin >> k;
    vector<int>v;
    int mx;
    for(int i=0; i < 60; i++){
        if((1ll<<i)&k)v.pb(i+1), mx=i+1;
    }
    if(k<=19)mx=max(mx, 5ll);
    for(int i=1; i <= mx; i++){
        for(int j=1; j <= mx; j++){
            c[i][j]='r';
        }
        c[i][mx]='d';
    }
    c[mx][mx]='.';
    for(int i=1; i < v.back(); i++){
        c[i][i]='X';
        c[i][i+1]='d';
    }
    for(int i=0; i < v.size()-1; i++){
        c[v[i]][v[i]+1]='X';
    }
    cout << mx << ' ' << mx << '\n';
    for(int i=1; i <= mx; i++){
        for(int j=1; j <= mx; j++){
            cout << c[i][j];
        }
        cout << '\n';
    }
}
signed main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int RealName=1;
    // cin >> RealName;
    // srand(time(0));

    while(RealName--)
        AlemAmenov();
    
return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...