# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
335789 | 2020-12-14T02:55:07 Z | beksultan04 | Red-blue table (IZhO19_stones) | C++14 | 46 ms | 1516 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define OK puts("OK"); #define fr first #define sc second #define ret return #define scan1(a) scanf("%lld",&a); #define scan2(a,b) scanf("%lld %lld",&a, &b); #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define all(s) s.begin(),s.end() #define pb push_back #define endi puts(""); const int N = 1e6+12,INF=1e9+7; int m1[N],p[N]; char q[1001][1001]; main(){ int t; scan1(t) while (t--){ int i,j,n,m,ans=0; scan2(n,m) if (n <= m){ for (i=0;i<n;++i){ for (j=0;j<m;++j){ if (i < n/2+1){ q[i][j]='-'; m1[j]++; } else { q[i][j]='+'; p[i]++; } } } } else { for (i=0;i<n;++i){ for (j=0;j<m;++j){ if (j < m/2+1){ q[i][j]='+'; p[i]++; } else { m1[j]++; q[i][j]='-'; } } } } ans = max(n,m); ans += min(n-1,m-1)/2; cout <<ans<<"\n"; for (i=0;i<n;++i){ for (j=0;j<m;++j){ cout <<q[i][j]; } endi; } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 364 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Incorrect | 3 ms | 492 KB | Wrong answer in test 5 29: 31 < 32 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 44 ms | 1516 KB | Wrong answer in test 97 21: 107 < 116 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 46 ms | 1516 KB | Wrong answer in test 24 24: 35 < 44 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 364 KB | Output is correct |
2 | Correct | 1 ms | 364 KB | Output is correct |
3 | Correct | 1 ms | 364 KB | Output is correct |
4 | Incorrect | 3 ms | 492 KB | Wrong answer in test 5 29: 31 < 32 |