Submission #528099

# Submission time Handle Problem Language Result Execution time Memory
528099 2022-02-19T09:13:51 Z Bilegt Red-blue table (IZhO19_stones) C++14
27 / 100
73 ms 1224 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int MOD = 1e9 + 7;
const int INF = 1e9 + 1000;

void nemeh(int a, int b){
     int x, y, q, w, e;
     cout << a + (b - (b / 2 +1))<<endl;
     for(q = 1;q <= a; q++){
          for( w = 1; w <= b / 2 +1;w++){
               cout << '+'; 
          }
          for( w = b/ 2+2; w <= b; w++){
               cout << '-';
          }
          cout << endl;
     }
}
void hasah(int a, int b){
     int x, y, q, w, e;
     cout << b + (a - (a / 2 +1))<<endl;
     for(q = 1;q <= a/2+1; q++){
          for( w = 1; w <= b;w++){
               cout << '-'; 
          }
          cout << endl;
     }
     for(q = a/2+2;q <= a; q++){
          for( w = 1; w <= b;w++){
               cout << '+'; 
          }
          cout << endl;
     }
}
void tentsuu(int a, int b){
     int x, y, q, w, e;
     cout << a + (a-(a / 2 +1))<<endl;
     for(q = 1;q <= a; q++){
          for( w = 1; w <= a / 2 +1;w++){
               cout << '+'; 
          }
          for( w = a/ 2+2; w <= a; w++){
               cout << '-';
          }
          cout << endl;
     }
}
int main(){
	int t;
	cin >> t;
	while(t--){
	     int a, b, c, d, e, f;
	     cin >> a >> b;
	     if(a == b){
	          tentsuu(a, b);
	     }
	     if(a > b){
	          nemeh(a, b);
	     }
	     if(a < b){
	          hasah(a, b);
	     }
	}
	return 0;
}

Compilation message

stones.cpp: In function 'void nemeh(int, int)':
stones.cpp:9:10: warning: unused variable 'x' [-Wunused-variable]
    9 |      int x, y, q, w, e;
      |          ^
stones.cpp:9:13: warning: unused variable 'y' [-Wunused-variable]
    9 |      int x, y, q, w, e;
      |             ^
stones.cpp:9:22: warning: unused variable 'e' [-Wunused-variable]
    9 |      int x, y, q, w, e;
      |                      ^
stones.cpp: In function 'void hasah(int, int)':
stones.cpp:22:10: warning: unused variable 'x' [-Wunused-variable]
   22 |      int x, y, q, w, e;
      |          ^
stones.cpp:22:13: warning: unused variable 'y' [-Wunused-variable]
   22 |      int x, y, q, w, e;
      |             ^
stones.cpp:22:22: warning: unused variable 'e' [-Wunused-variable]
   22 |      int x, y, q, w, e;
      |                      ^
stones.cpp: In function 'void tentsuu(int, int)':
stones.cpp:38:10: warning: unused variable 'x' [-Wunused-variable]
   38 |      int x, y, q, w, e;
      |          ^
stones.cpp:38:13: warning: unused variable 'y' [-Wunused-variable]
   38 |      int x, y, q, w, e;
      |             ^
stones.cpp:38:22: warning: unused variable 'e' [-Wunused-variable]
   38 |      int x, y, q, w, e;
      |                      ^
stones.cpp: In function 'int main()':
stones.cpp:54:17: warning: unused variable 'c' [-Wunused-variable]
   54 |       int a, b, c, d, e, f;
      |                 ^
stones.cpp:54:20: warning: unused variable 'd' [-Wunused-variable]
   54 |       int a, b, c, d, e, f;
      |                    ^
stones.cpp:54:23: warning: unused variable 'e' [-Wunused-variable]
   54 |       int a, b, c, d, e, f;
      |                       ^
stones.cpp:54:26: warning: unused variable 'f' [-Wunused-variable]
   54 |       int a, b, c, d, e, f;
      |                          ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 292 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 292 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 6 ms 204 KB Output is correct
4 Incorrect 10 ms 340 KB Wrong answer in test 5 29: 31 < 32
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 1224 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 73 ms 1164 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 292 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 6 ms 204 KB Output is correct
4 Incorrect 10 ms 340 KB Wrong answer in test 5 29: 31 < 32
5 Halted 0 ms 0 KB -