Submission #173229

#TimeUsernameProblemLanguageResultExecution timeMemory
173229GoldeNRed-blue table (IZhO19_stones)C++17
27 / 100
34 ms1400 KiB
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define f first #define s second #define pb push_back #define all(a) a.begin(),a.end() typedef long long ll; typedef long double ld; typedef pair <int,int> pii; typedef pair <ll,ll> pll; typedef vector <ll> vl; typedef vector <int> vi; typedef vector <bool> vb; typedef vector <vector <int> > vvi; typedef vector <vector <ll> > vvl; typedef vector <pair<int,int> > vii; typedef vector <pair<ll,ll> > vll; string itos(int n) {stringstream ss;ss<<n;string s=ss.str();return s;} ll ppow(ll x,ll y,ll mod) { ll res=1; while(y) { if(y&1) res=res*x%mod; y>>=1; x=x*x%mod; } return res; } int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int t; cin >> t; while (t--) { int n,m; cin >> n >> m; int mx=max(m/2-1+m%2+n,n/2-1+n%2+m); cout << mx << "\n"; if (mx == m/2-1+m%2+n) { for (int i=1;i<=n;++i) { for (int j=1;j<=m;++j) { if (j <= m/2-1+m%2) { cout << '-'; } else { cout << '+'; } } cout << "\n"; } } else { for (int i=1;i<=n;++i) { for (int j=1;j<=m;++j) { if (i <= n/2-1+n%2) { cout << '+'; } else { cout << '-'; } } cout << "\n"; } } } }
#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...