답안 #755613

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
755613 2023-06-10T12:14:18 Z DJeniUp Costinland (info1cup19_costinland) C++17
63.589 / 100
1 ms 340 KB
#include "bits/stdc++.h"
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll>pairll;
typedef pair<ll,ull>pairull;
typedef pair<ll,pairll>pair3l;
typedef long double ld;
typedef pair<ld,ll>pairld;
 
#define fr first
#define sc second
#define pb push_back
#define endl '\n'
#define N 100007
//#define MOD 998244353
#define INF 10000000000007
#define eps 0.0000000001
 
ll n,m,k,d[107][107];

int main(){
    
    cin>>k;
    n=3;
    ll x=2;
    while(x*2<=k){
        x*=2;
        n++;
    }
    x=1;
    for(int i=1;i<n;i++){
        if((k&x)!=0){
            d[i][i+1]=3;
        }else d[i][i+1]=1;
        d[i+1][i]=2;
        x*=2;
        
        d[i][n]=1;
        d[n][i]=2;
        d[i][i]=3;
    }
    d[n-1][n-1]=0;
    cout<<n<<" "<<n<<endl;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(d[i][j]==1)cout<<"d";
            else if(d[i][j]==2)cout<<"r";
            else if(d[i][j]==3)cout<<"X";
            else cout<<".";
        }
        cout<<endl;
    }
 
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Correct! Your size: 3
2 Correct 1 ms 212 KB Correct! Your size: 4
3 Correct 1 ms 300 KB Correct! Your size: 4
4 Correct 1 ms 304 KB Correct! Your size: 4
5 Correct 1 ms 212 KB Correct! Your size: 4
6 Correct 1 ms 212 KB Correct! Your size: 5
7 Correct 1 ms 212 KB Correct! Your size: 5
8 Correct 1 ms 212 KB Correct! Your size: 5
9 Partially correct 1 ms 212 KB Partially Correct! Your size: 6
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 340 KB Partially Correct! Your size: 60
2 Partially correct 1 ms 280 KB Partially Correct! Your size: 60
3 Partially correct 1 ms 340 KB Partially Correct! Your size: 61
4 Partially correct 1 ms 340 KB Partially Correct! Your size: 61
5 Partially correct 1 ms 340 KB Partially Correct! Your size: 61
6 Partially correct 1 ms 340 KB Partially Correct! Your size: 61
7 Partially correct 1 ms 308 KB Partially Correct! Your size: 61
8 Partially correct 1 ms 340 KB Partially Correct! Your size: 59