Submission #894321

#TimeUsernameProblemLanguageResultExecution timeMemory
894321GrayRed-blue table (IZhO19_stones)C++17
27 / 100
20 ms1372 KiB
#include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define ln "\n" const ll INF = 2e18; const ll MOD = 1e9+7; using namespace std; void solve(){ ll x, y; cin >> x >> y; if (x>y){ ll fr = y/2+1; cout << x+y-fr << ln; // ll fc = x-x/2; for (ll rc=0; rc<x; rc++){ for (ll i=0; i<fr; i++){ cout << '+'; } for (ll i=fr; i<y; i++){ cout << '-'; } cout << ln; } }else{ ll fc = x/2+1; cout << y+x-fc << ln; for (ll rc=0; rc<fc; rc++){ for (ll i=0; i<y; i++){ cout << '-'; } cout << ln; } for (ll rc=fc; rc<x; rc++){ for (ll i=0; i<y; i++){ cout << '+'; } cout << ln; } } } int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); ll t=1; cin >> t; while (t--) 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...