# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
544857 | MilosMilutinovic | Red-blue table (IZhO19_stones) | C++14 | 2075 ms | 764 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<typename T> bool chkmax(T &x,T y){return x<y?x=y,1:0;}
template<typename T> bool chkmin(T &x,T y){return x>y?x=y,1:0;}
int n,m;
void solve(){
scanf("%d%d",&n,&m);
int ans=n,tx=0,ty=0;
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++){
vector<int> row(n+1),col(m+1);
for(int x=1;x<=n;x++)for(int y=1;y<=m;y++){
int b=((x<=i&&y<=j)?-1:1);
row[x]+=b; col[y]+=b;
}
int tans=0;
for(int x=1;x<=n;x++)if(row[x]>0)tans++;
for(int y=1;y<=m;y++)if(col[y]<0)tans++;
if(tans>ans)ans=tans,tx=i,ty=j;
}
printf("%d\n",ans);
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++)printf("%c",(i<=tx&&j<=ty?'-':'+'));
printf("\n");
}
}
int main(){
int T;
scanf("%d",&T);
while(T--)solve();
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... |