Submission #857124

#TimeUsernameProblemLanguageResultExecution timeMemory
857124Halym2007Red-blue table (IZhO19_stones)C++11
0 / 100
43 ms1392 KiB
#include <bits/stdc++.h> using namespace std; int a,b,c,d,t; bool tr1, tr2; int main(){ cin>>t; while(t--){ cin>>a>>b; tr1 = true; if(a == 1 or b == 1){ cout<<max(a, b)<<endl; if(a == 1) for(int i=1; i <= b; i++) cout<<'+'; if(b == 1) for(int i=1; i <= a; i++) cout<<'-'<<endl; } else{ cout<<a + b - 2<<endl; for(int i=1; i <= a; i++){ if(i == a){ for(int j=1; j <= b; j++) cout<<'-'; } else{ cout<<'+'; if(tr1 == true){ tr2 = true; for(int j=2; j <= b; j++){ if(tr2 == true){ cout<<'-'; tr2 = false; continue; } else{ cout<<'+'; tr2 = true; } } tr1 = false; } else{ tr2 = false; for(int j=2; j <= b; j++){ if(tr2 == false){ cout<<'+'; tr2 = true; continue; } else{ cout<<'-'; tr2 = false; } } tr1 = true; } } cout<<endl; } } } } //DONE
#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...