# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
238849 | 2020-06-13T08:17:28 Z | arnold518 | Red-blue table (IZhO19_stones) | C++14 | 63 ms | 2272 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 1000; int TC, N, M; char S[MAXN+10][MAXN+10]; int main() { int i, j, k; scanf("%d", &TC); while(TC--) { scanf("%d%d", &N, &M); int ans=0; pii t; for(i=0; i<=N; i++) { for(j=0; j<=M; j++) { int x=min((M-1)/2, j); int y=max(0, i-(N-1)/2); if(x*i>=y*j) { if(ans<=i+j) ans=i+j, t={i, j}; } } } for(i=0; i<N; i++) for(j=0; j<M; j++) S[i][j]='+'; int a=t.first, b=t.second; int x=min((M-1)/2, b); int y=max(0, a-(N-1)/2); for(j=0, i=0; j<b; j++) { for(k=0; k<y; k++, i=(i+1)%a) { S[i][j]='-'; } } for(i=a; i<N; i++) for(j=0; j<b; j++) S[i][j]='-'; printf("%d\n", ans); for(i=0; i<N; i++) { for(j=0; j<M; j++) printf("%c", S[i][j]); printf("\n"); } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 57 ms | 1528 KB | Output is correct |
2 | Correct | 53 ms | 1912 KB | Output is correct |
3 | Correct | 51 ms | 2168 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 56 ms | 1400 KB | Output is correct |
2 | Correct | 47 ms | 1912 KB | Output is correct |
3 | Correct | 49 ms | 1656 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 384 KB | Output is correct |
3 | Correct | 6 ms | 384 KB | Output is correct |
4 | Correct | 7 ms | 384 KB | Output is correct |
5 | Correct | 57 ms | 1528 KB | Output is correct |
6 | Correct | 53 ms | 1912 KB | Output is correct |
7 | Correct | 51 ms | 2168 KB | Output is correct |
8 | Correct | 56 ms | 1400 KB | Output is correct |
9 | Correct | 47 ms | 1912 KB | Output is correct |
10 | Correct | 49 ms | 1656 KB | Output is correct |
11 | Correct | 15 ms | 640 KB | Output is correct |
12 | Correct | 49 ms | 1912 KB | Output is correct |
13 | Correct | 55 ms | 2012 KB | Output is correct |
14 | Correct | 34 ms | 1664 KB | Output is correct |
15 | Correct | 63 ms | 2272 KB | Output is correct |
16 | Correct | 42 ms | 1912 KB | Output is correct |
17 | Correct | 22 ms | 1280 KB | Output is correct |