제출 #498588

#제출 시각아이디문제언어결과실행 시간메모리
498588The_SamuraiRed-blue table (IZhO19_stones)C++98
0 / 100
41 ms1516 KiB
#include <bits/stdc++.h> using namespace std; /* 6 6 ++++-- ++++-- ------ ------ --++++ --++++ 8 8 +++++--- +++++--- +++++--- -------- -------- ---+++++ ---+++++ ---+++++ 7 7 ++++--- ++++--- ++++--- ---+--- ---++++ ---++++ ---++++ */ void solve() { int n, m; cin >> n >> m; if (n == 1) { cout << "1\n+\n"; return; } if (n == 2) { cout << "2\n++\n++\n"; return; } if (n == 4) { cout << "5\n++++\n----\n----\n----\n"; return; } if (n % 2 == 1) { cout << 2 * n - 2; } else { cout << 2 * n - 4; } cout << '\n'; for (int i = 0; i < (n - 1) / 2; i++) { for (int j = 0; j < n / 2 + 1; j++) { cout << '+'; } for (int j = n / 2 + 1; j < n; j++) { cout << '-'; } cout << '\n'; } for (int i = 0; i < 2 - n % 2; i++) { for (int j = 0; j < n; j++) { cout << '-'; } cout << '\n'; } for (int i = 0; i < (n - 1) / 2; i++) { for (int j = 0; j < (n - 1) / 2; j++) { cout << '-'; } for (int j = (n - 1) / 2; j < n; j++) { cout << '+'; } cout << '\n'; } } int main() { 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...