Submission #874397

#TimeUsernameProblemLanguageResultExecution timeMemory
874397tvladm2009Red-blue table (IZhO19_stones)C++17
27 / 100
17 ms1372 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; while (t--) { int n, m; cin >> n >> m; int ans = 0, lines = 0; for (int i = 0; i <= n; ++i) { int cur = i + (m % 2 ? m / 2 : m / 2 - 1); if (n - i > i) { cur = i + m; } if (cur > ans) { ans = cur; lines = i; } } cout << ans << "\n"; for (int i = 1; i <= n; ++i) { if (i <= lines) { for (int j = 1; j <= m; ++j) { if (j <= m / 2 + 1) { cout << "+"; } else { cout << "-"; } } cout << "\n"; } else { for (int j = 1; j <= m; ++j) { cout << "-"; } cout << "\n"; } } } 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...