Submission #1012736

#TimeUsernameProblemLanguageResultExecution timeMemory
1012736Nika533Costinland (info1cup19_costinland)C++17
0 / 100
1 ms456 KiB
#pragma gcc diagnostic "-std=c++1z" #include <bits/stdc++.h> #define int long long #define pb push_back #define f first #define s second #define MOD 1000000007 #define pii pair<int,int> #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(),(x).rend() using namespace std; int n,m,T,k; void test_case() { n=49; m=49; cin>>k; char arr[n+5][m+5]; for (int i=1; i<=n; i++) { for (int j=1; j<=m; j++) { arr[i][j]='.'; } } for (int i=1; i<=n-1; i++) arr[i][m]='d'; for (int i=1; i<=m-1; i++) arr[n][i]='r'; vector<int> v; v.pb(1e9); while (k) { v.pb(k%6); k/=6; } int sz=v.size()-1; for (int i=1; i<sz; i++) { int j=1+(i-1)*2; arr[j][j]='X'; arr[j+1][j]='X'; arr[j][j+1]='X'; arr[j+1][j+1]='X'; arr[j][j+2]='d'; arr[j+1][j+2]='d'; arr[j+2][j]='r'; arr[j+2][j+1]='r'; if (v[i]==1) { arr[j][j+2]='X'; } if (v[i]==2) { arr[j+1][j+2]='X'; } if (v[i]==3) { arr[j][j+2]='X'; arr[j+1][j+2]='X'; } if (v[i]==4) { arr[j][j+2]='X'; arr[j+1][j+2]='X'; arr[j+2][j]='X'; } if (v[i]==5) { arr[j][j+2]='X'; arr[j+1][j+2]='X'; arr[j+2][j+1]='X'; } } int j=1+(sz-1)*2; if (v[sz]==2) { arr[j][j]='X'; } if (v[sz]==3) { arr[j][j]='X'; arr[j][j+1]='X'; } if (v[sz]==4) { arr[j][j]='X'; arr[j][j+1]='X'; arr[j+1][j]='X'; } if (v[sz]==5) { arr[j][j]='X'; arr[j][j+1]='X'; arr[j+1][j]='X'; arr[j+2][j]='X'; } cout<<n<<" "<<m<<endl; for (int i=1; i<=n; i++) { for (int j=1; j<=m; j++) { cout<<arr[i][j]; } cout<<endl; } } main () { ios :: sync_with_stdio(0); cin.tie(0); cout.tie(0); T=1; while (T--) test_case(); }

Compilation message (stderr)

costinland.cpp:1: warning: ignoring '#pragma gcc diagnostic' [-Wunknown-pragmas]
    1 | #pragma gcc diagnostic "-std=c++1z"
      | 
costinland.cpp:92:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   92 | main () {
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...