제출 #1156464

#제출 시각아이디문제언어결과실행 시간메모리
1156464UmairAhmadMirzaRed-blue table (IZhO19_stones)C++20
27 / 100
35 ms1352 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long int const N=2e5+5; int const mod=1e9+7; int n,m; int calcu(vector<vector<bool>> v){ // cout<<n<<' '<<m<<endl; int a=0; for(int i=0;i<n;i++){ int c=0; for(int j=0;j<m;j++) if(v[i][j]==1) c++; if(c*2>m) a++; } for(int j=0;j<m;j++){ int c=0; for(int i=0;i<n;i++){ if(v[i][j]==0) c++; } if(c*2>n) a++; } return a; } void solve(){ // int n,m; cin>>n>>m; vector<vector<bool>> a1,a2,a3,a4; int hm=(m/2)+1,hn=(n/2)+1; if(m+(n-hn)>(n+(m-hm))){ cout<<m+(n-hn)<<endl; for (int i = 1; i <=n; ++i) { for(int j=1;j<=m;j++){ if(j<=hm && i<=(n-hn)) cout<<'+'; else cout<<'-'; } cout<<endl; } } else{ cout<<n+(m-hm)<<endl; for (int i = 1; i <=n; ++i) { for(int j=1;j<=m;j++){ if(i<=hn && j<=(m-hm)) cout<<'-'; else cout<<'+'; } cout<<endl; } } } int main(){ int t; cin>>t; while(t--) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...