Submission #201866

#TimeUsernameProblemLanguageResultExecution timeMemory
201866guangxuanRed-blue table (IZhO19_stones)C++14
27 / 100
40 ms1436 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int T; scanf("%d",&T); while(T--){ int n,m; scanf("%d%d",&n,&m); int ans1 = n + (m-1)/2, ans2 = m + (n-1)/2; printf("%d\n",max(ans1,ans2)); if(ans1>ans2){ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(j<(m-1)/2)printf("-"); else printf("+"); } puts(""); } } else{ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(i<(n-1)/2)printf("+"); else printf("-"); } puts(""); } } } }

Compilation message (stderr)

stones.cpp: In function 'int main()':
stones.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&T);
  ~~~~~^~~~~~~~~
stones.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d%d",&n,&m);
   ~~~~~^~~~~~~~~~~~~~
#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...