Submission #892238

#TimeUsernameProblemLanguageResultExecution timeMemory
892238dilshod9890Red-blue table (IZhO19_stones)C++17
10 / 100
17 ms1372 KiB
#include <bits/stdc++.h> #include <algorithm> #include <map> using namespace std; using ll = long long; #define gcd __gcd void solve() { ll a,b; cin >> a >> b; if (a>=b){ if (b==2){ cout << a << "\n"; for (int i = 0; i < a; i++){ for (int i = 0; i < b; i++){ cout << '+'; } cout << "\n"; } }else{ cout << a+(b/2); cout << "\n"; for (int i = 0; i < a; i++){ for (int i = 0; i < b-(b/2); i++){ cout << '+'; } for (int i = 0; i < (b/2); i++){ cout << '-'; } cout << "\n"; } } }else if (a<b){ if (a==2){ cout << b << "\n"; for (int i = 0; i < a; i++){ for (int i = 0; i < b; i++){ cout << '-'; } cout << "\n"; } }else{ cout << b+(a/2); cout << "\n"; for (int i = 0; i < a-(a/2); i++){ for (int i = 0; i < b; i++){ cout << '-'; } cout << "\n"; } for (int i = 0; i < (a/2); i++){ for (int i = 0; i < b; i++)cout << '+'; cout << "\n"; } } } } int main() { cin.tie(0)->sync_with_stdio(false); #ifdef null freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int q = 1; cin >> q; while (q--) { 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...