Submission #499707

#TimeUsernameProblemLanguageResultExecution timeMemory
499707SOIVIEONERed-blue table (IZhO19_stones)C++14
27 / 100
38 ms1488 KiB
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> #define INF 1000000021 #define pb push_back #define sqr(a) (a)*(a) #define M(a, b) make_pair(a,b) #define F first #define S second #define all(x) (x.begin(), x.end()) #define deb(x) cerr << #x << " = " << x << '\n' #define N 322222 using namespace std; //using namespace __gnu_pbds; typedef long double ld; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; typedef vector<ll> vll; //typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; const ll MOD = 1000000007ll; ll bn(ll aa, ll n) { ll r = 1ll; for(; n > 0; n >>= 1ll) { if(n & 1) r = (r * aa) % MOD; aa = (aa * aa) % MOD; } return r; } const ld pi = 2 * acos(0.0); //template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;} //int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; char a[1234][1234]; void solve() { int n, m; cin >> n >> m; int ans = 0; if(n < m) { for(int i = 1; i <= n; i ++) for(int j = 1; j <= m; j ++) { if(i <= n / 2 + 1) a[i][j] = '-'; else a[i][j] = '+'; } ans = m + max(0, n - n / 2 - 1); } else { for(int i = 1; i <= n; i ++) for(int j = 1; j <= m; j ++) { if(j <= m / 2 + 1) a[i][j] = '+'; else a[i][j] = '-'; } ans = n + max(0, m - m / 2 - 1); } cout << ans << '\n'; for(int i = 1; i <= n; i ++, cout << '\n') for(int j = 1; j <= m; j ++) cout << a[i][j]; } int main() { int t = 1; cin >> t; while(t --) solve(); 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...