제출 #856986

#제출 시각아이디문제언어결과실행 시간메모리
856986Halym2007Red-blue table (IZhO19_stones)C++11
11 / 100
22 ms1372 KiB
#include <iostream> #include <algorithm> #include <math.h> using namespace std; #define ll long long #define N 200005 #define pb push_back #define ff first #define ss second #define pp pop_back #define sz(s) (int)s.size() ll a[N], t, T, n, m; int main () { cin >> T; while (T--) { cin >> n >> m; if (n == 1) { cout << m << '\n'; for (int i = 1; i <= m; i++) { cout <<"-"; } cout << '\n'; continue; } else if (m == 1) { cout << n << '\n'; for(int j=1;j<=n; j++){ for (int i = 1; i <= m; i++) { cout << "+"; } cout << '\n'; } continue; } cout << n+m-2 << '\n'; for (int i = 1; i < n; i++) { if (i % 2 != 0) { for(int j = 1; j <= m; j++) { if (j % 2 != 0 or j == m) { cout<<"+"; } else cout<<"-"; } cout<<'\n'; continue; } for (int j = 1; j <= m; j++) { if(j % 2 != 0 and j != m) cout<<"-"; else cout << "+"; } cout << '\n'; } for (int i = n; i > 0; i--) { for (int j = 1; j <= m; j++) { cout<<'-'; } cout<<'\n'; break; } } }
#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...