| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 201987 | guangxuan | Red-blue table (IZhO19_stones) | C++14 | 13 ms | 2296 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
char ans[1002][1002];
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;
for(int x=1;x<m;x++){
if((n*x + (m-1)/2 + x - 1)/((m-1)/2 + x) <= (n-1)/2)ans1++;
else break;
}
for(int x=1;x<n;x++){
if((m*x + (n-1)/2 + x - 1)/((n-1)/2 + x) <= (m-1)/2)ans2++;
else break;
}
printf("%d\n",max(ans1,ans2));
if(ans1>ans2){
int x = ans1 - (n+(m-1)/2);
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(j<x+(m-1)/2)ans[i][j]='-';
else ans[i][j]='+';
}
for (int j = i * x; j< (i+1) * x; j++){
ans[i][j%(x+(m-1)/2)] = '+';
}
ans[i][m] = '\0';
}
}
else{
int x = ans2 - (m+(n-1)/2);
for(int j=0;j<m;j++){
for(int i=0;i<n;i++){
if(i<x+(n-1)/2)ans[i][j]='+';
else ans[i][j]='-';
}
for (int i = j * x; i< (j+1) * x; i++){
ans[i%(x+(n-1)/2)][j] = '-';
}
}
for(int i=0;i<n;i++)ans[i][m]='\0';
}
for(int i=0;i<n;i++)printf("%s\n",ans[i]);
}
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
