제출 #341825

#제출 시각아이디문제언어결과실행 시간메모리
341825RedhoodRed-blue table (IZhO19_stones)C++14
27 / 100
36 ms1388 KiB
#include<bits/stdc++.h> #define fi first #define se second #define len(x) (int)(x).size() #define pb push_back #define p2(x) (x)*(x) #define all(x) (x).begin() , (x).end() #define mkp make_pair //#pragma GCC optimize("unroll-loops") //#pragma GCC optimize("Ofast") //#pragma GCC optimize("-O3") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; typedef long double ld; typedef long long ll; void solve(){ int n , m; cin >> n >> m; /// red okay??? /// lulz if(n > m){ int need; need = (m + 2) / 2; int ans = n + m - need; cout << ans << '\n'; for(int i = 0 ; i < n; ++i){ for(int j = 0 ; j < need; ++j) cout << "+"; for(int j = need; j < m ; ++j) cout << "-"; cout << '\n'; } }else{ int need; need = (n + 2) / 2; int ans = n + m - need; vector < vector < char > > a(n , vector < char > (m , '+')); for(int j = 0 ; j < m; ++j){ for(int i = 0 ; i < need ; ++i) a[i][j] = '-'; } cout << ans << '\n'; for(auto i : a){ for(auto j : i){ cout << j; } cout << '\n'; } } } int main(){ ios_base::sync_with_stdio(0) , cin.tie(0) , cout.tie(0); int t; 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...