This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |