제출 #657794

#제출 시각아이디문제언어결과실행 시간메모리
657794DepressionRed-blue table (IZhO19_stones)C++14
0 / 100
22 ms1408 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define ppb pop_back #define F first #define S second #define maxe *max_element #define mine *min_element #define pll pair<ll, ll> #define all(x) x.begin(), x.end() #define sz(a) (int)a.size() #define kchau ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); const ll INF = 1e18 + 7; const ll MOD = 1e9 + 7; const ll BLOCK = 700; const ll T = 2006; const ll SP = 2e5 + 7; const ll N = 1e6 + 7; using namespace std; char a[1005][1005]; int main(){ kchau // freopen("tiles.in", "r", stdin); // freopen("tiles.out", "w", stdout); ll t; cin >> t; while(t--){ ll n, m; cin >> n >> m; ll res = max(n, m) + (min(n, m) - 1) / 2; if(n <= m){ for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ if(i == n - 1 && i % 2 == 1){ a[i][j] = '-'; } else if(i % 2 == 0){ a[i][j] = '-'; } else { a[i][j] = '+'; } } } } else { for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ if(i == n - 1 && i % 2 == 1){ a[j][i] = '+'; } else if(i % 2 == 0){ a[j][i] = '+'; } else { a[j][i] = '-'; } } } } cout << res << '\n'; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cout << a[i][j]; } 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...