Submission #690864

#TimeUsernameProblemLanguageResultExecution timeMemory
690864Nuraly_SerikbayRed-blue table (IZhO19_stones)C++14
27 / 100
25 ms1356 KiB
/* Speech to the young */ //#include <bits/stdc++.h> #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits> #include <vector> #include <climits> #include <cstring> #include <cstdlib> #include <fstream> #include <numeric> #include <sstream> #include <cassert> #include <iomanip> #include <iostream> #include <algorithm> #include <stdio.h> #include <fstream> #include <unordered_map> using namespace std; #define pb push_back #define all(x) x.begin(),x.end() #define F first #define S second #define YOSIK() ios_base::sync_with_stdio(0),cin.tie(0) #define int long long #define pans cout << "\n------ans-------\n" const int N = 1e6 + 10; const int INF = 1e18 + 7; const int MOD = 1e9 + 7; const int P = 31; int n, m; void Solution () { cin >> n >> m; if (n <= m) { cout << (n >= 3 ? 1 : 0) + m << '\n'; for (int i = 1; i <= n; ++ i) { for (int j = 1; j <= m; ++ j) { if (i <= max (2ll, n - 1)) cout << "-"; else cout << '+'; } cout << '\n'; } } else { cout << (m >= 3 ? 1 : 0) + n << '\n'; for (int i = 1; i <= n; ++ i) { for (int j = 1; j <= m; ++ j) { if (j <= max (2ll, m - 1)) cout << "+"; else cout << '-'; } cout << '\n'; } } return; } signed main () { YOSIK(); // precalc(); int T = 1; cin >> T; while (T --) Solution (); exit (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...