Submission #444732

#TimeUsernameProblemLanguageResultExecution timeMemory
444732nickyrioRed-blue table (IZhO19_stones)C++17
0 / 100
33 ms1228 KiB
#include <bits/stdc++.h> using namespace std; void Solve() { int n, m, ans = 0; cin >> n >> m; pair<int, int> best = {0, 0}; for (int i = 0; i <= n; ++ i) { for (int j = 0; j <= m; ++j) { int curr = j * (i * 2 > n) + i * (j * 2 < m); if (curr > ans) { ans = curr; best = {i, j}; } } } cout << ans << '\n'; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (i < best.first && j < best.second) cout << '-'; else cout << '+'; } cout << '\n'; } } int main() { ios::sync_with_stdio(false); cin.tie(NULL); int test; cin >> test; while (test--) 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...