Submission #899161

#TimeUsernameProblemLanguageResultExecution timeMemory
899161giorgitsibadzeRed-blue table (IZhO19_stones)C++14
0 / 100
24 ms1372 KiB
#include <bits/stdc++.h> using namespace std; void solve() { int n, m; cin >> n >> m; char a[n + 1][m + 1]; if(n == 1) { for(int i = 1; i <= m; i++)cout << '-'; cout << '\n'; return; } for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { if(j % 2 == 1) { a[i][j] = '+'; } else a[i][j] = '-'; if(m % 2 == 0 and j == m)a[i][j] = '+'; } } int ans = n + m / 2; if(m % 2 == 0)ans--; cout << ans << '\n'; for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { cout << a[i][j]; } cout << '\n'; } } int main() { int t; cin >> t; while(t--) { solve(); } 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...