| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 788586 | BidoTeima | Red-blue table (IZhO19_stones) | C++17 | 73 ms | 2208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n,m;
cin>>n>>m;
bool s = 0;
if(n < m){
swap(n, m);
s = 1;
}
char grid[n][m];
multiset<pair<int,int>>ms;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
grid[i][j]='+';
}
if((m-1)/2){
ms.insert({(m-1)/2, i});
}
}
int c=0;
while(ms.size() >= n/2+1){
if(ms.size()>=n/2+1){c++;}
vector<multiset<pair<int,int>>::iterator>toErase;
int iter=0;
for(auto it = prev(ms.end()); iter<n/2+1; --it,++iter){
toErase.push_back(it);
grid[it->second][c - 1] = '-';
}
for(auto it:toErase){
int val=it->first,row=it->second;
ms.erase(it);
if(val != 1){
ms.insert({val - 1, row});
}
}
}
cout<<n+c<<'\n';
if(s){
for(int j = 0; j < m; j++){
for(int i = 0; i < n; i++){
cout<<(grid[i][j]=='+'?'-':'+');
}
cout<<'\n';
}
}else{
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cout<<grid[i][j];
}
cout<<'\n';
}
}
}
return 0;
}
컴파일 시 표준 에러 (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... | ||||
