Submission #499702

#TimeUsernameProblemLanguageResultExecution timeMemory
499702sireanu_vladRed-blue table (IZhO19_stones)C++14
27 / 100
4 ms1228 KiB
#include <iostream> #include <cstring> using namespace std; void solve(int n, int m) { cout << (m + (n-1)/2) << '\n'; for(int i = 0; i < n; ++i) cout << (i <= n/2 ? string(m, '-') : string(m, '+')) << '\n'; } void solve2(int n, int m) { cout << (n + (m-1)/2) << '\n'; for(int i = 0; i < n; ++i) cout << string(m/2 + 1, '+') << string((m-1)/2, '-') << '\n'; } int main() { int t, n, m; cin >> t; while(t--) { cin >> n >> m; if(n < m) solve(n, m); else solve2(n, m); } return 0; }
#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...