답안 #201866

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
201866 2020-02-12T11:28:03 Z guangxuan Red-blue table (IZhO19_stones) C++14
27 / 100
40 ms 1436 KB
#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

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);
   ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Incorrect 6 ms 376 KB Wrong answer in test 5 29: 31 < 32
# 결과 실행 시간 메모리 Grader output
1 Incorrect 40 ms 1436 KB Wrong answer in test 97 21: 107 < 116
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 38 ms 1256 KB Wrong answer in test 24 24: 35 < 44
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 6 ms 376 KB Output is correct
4 Incorrect 6 ms 376 KB Wrong answer in test 5 29: 31 < 32