제출 #685254

#제출 시각아이디문제언어결과실행 시간메모리
685254heeheeheehaawCostinland (info1cup19_costinland)C++17
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> #define int long long using namespace std; char a[1005][1005]; int dp[1005][1005]; signed main() { int k; cin>>k; int l = floor(log2(k)) + 1; cout<<l<<" "<<l<<'\n'; for(int i = 1; i <= l; i++) for(int j = 1; j <= l; j++) a[i][j] = '.'; for(int i = 1; i < l; i++) { a[i][i] = 'X'; a[i - 1][i] = 'd'; a[i][i - 1] = 'r'; } for(int i = 1; i <= l; i++) { a[i][l] = 'd'; a[l][i] = 'r'; } a[l][l] = '.'; for(int i = 1; i < l - 1; i++) { if(((1 << i) & k) == false) continue; a[i + 1][i + 2] = 'X'; } for(int i = 1; i <= l; i++) { for(int j = 1; j <= l; j++) cout<<(char)a[i][j]; cout<<'\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...