Submission #337453

#TimeUsernameProblemLanguageResultExecution timeMemory
337453scalesRed-blue table (IZhO19_stones)C++17
100 / 100
85 ms9196 KiB
#include <bits/stdc++.h> /*#ifndef LOCAL_RUN #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") #pragma GCC target("avx2,tune=native") #endif*/ ////////////////////BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB using namespace std; long long a[1000][1000]; int main() { ios::sync_with_stdio(false); cin.tie(0); //freopen("","r",stdin); //freopen("","w",stdout); long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1; cin>>t; for(q=0;q<t;q++) { cin>>n; cin>>m; z=0; if(n>m) { z=1; swap(m,n); } kol=n*m-m*(n/2+1); kol=kol/(m/2+1); cout<<m+kol<<endl; for(i=0;i<n;i++) { for(j=0;j<m;j++) { a[i][j]=0; } } i=0; j=0; g=kol*(m/2+1); while(g!=0) { if(a[i][j]==0) { g--; a[i][j]=1; i++; j++; i=i%kol; j=j%m; } else { j++; j=j%m; } } if(z==0) { for(i=0;i<n;i++) { for(j=0;j<m;j++) { if(a[i][j]==1) { cout<<'+'; } else { cout<<'-'; } } cout<<endl; } } else { for(j=0;j<m;j++) { for(i=0;i<n;i++) { if(a[i][j]==0) { cout<<'+'; } else { cout<<'-'; } } cout<<endl; } } } return 0; }

Compilation message (stderr)

stones.cpp: In function 'int main()':
stones.cpp:17:21: warning: unused variable 'mini' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                     ^~~~
stones.cpp:17:26: warning: unused variable 'x' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                          ^
stones.cpp:17:28: warning: unused variable 'y' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                            ^
stones.cpp:17:36: warning: unused variable 'l' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                    ^
stones.cpp:17:38: warning: unused variable 'r' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                      ^
stones.cpp:17:40: warning: unused variable 'k' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                        ^
stones.cpp:17:46: warning: unused variable 'x1' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                              ^~
stones.cpp:17:49: warning: unused variable 'tip' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                                 ^~~
stones.cpp:17:55: warning: unused variable 'maxi' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                                       ^~~~
stones.cpp:17:62: warning: unused variable 'y1' [-Wunused-variable]
   17 |     long long t,i,j,mini,x,y,z,q,m,l,r,k,kol,x1,tip,g,maxi,n,y1;
      |                                                              ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...