Submission #334062

# Submission time Handle Problem Language Result Execution time Memory
334062 2020-12-08T09:01:25 Z boykut Red-blue table (IZhO19_stones) C++14
10 / 100
1 ms 364 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, m, flag = 0;
    cin >> n >> m;
    int a[n][m];
    
    if(n==1){
      cout<<m<<'\n';
      for(int i=0;i<m;i++)
        cout<<'-';
      cout<<'\n';
      continue;
    }
    if(m==1){
      cout<<n<<'\n';
      for(int i=0;i<n;i++)
        cout<<'+'<<'\n';
      continue;
    }
    if(n==2){
      cout<<m<<'\n';
      for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
          cout<<'-';
        cout<<'\n';
      }
      continue;
    }
    if(m==2){
      cout<<n<<'\n';
      for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
          cout<<'+';
        cout<<'\n';
      }
      continue;
    }
    if(n==3){
      cout<<m+1<<'\n';
      for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
          if(i%2==0)cout<<'-';
          else cout<<'+';
        cout<<'\n';
      }
      continue;
    }
    if(m==3){
      cout<<n+1<<'\n';
      for(int i=0;i<n;i++)
        cout<<"+-+\n";
    }
  }
  return 0;
}

Compilation message

stones.cpp: In function 'int main()':
stones.cpp:11:15: warning: unused variable 'flag' [-Wunused-variable]
   11 |     int n, m, flag = 0;
      |               ^~~~
stones.cpp:13:9: warning: unused variable 'a' [-Wunused-variable]
   13 |     int a[n][m];
      |         ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Incorrect 0 ms 364 KB Wrong answer