이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// Nurstan Duisengaliev
// не, не надо меня узнавать
/*#pragma GCC target ("avx2")
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("O3")*/
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define all(x) x.begin(), x.end()
#define in insert
#define mp make_pair
#define F first
#define S second
#define ppf pop_front
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pii pair <int, int>
#define pll pair <ll, ll>
#define boost() ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) (int)x.size()
using namespace std;
//using namespace __gnu_pbds;
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int N = 1005;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18 + 1;
int a[N][N];
void solve () {
int n, m;
cin >> n >> m;
for (int i = 1; i <= n; i ++) {
for (int j = 1; j <= m; j ++) a[i][j] = 1;
}
if (min (n, m) != 1) {
for (int i = 1; i <= n / 2 + 1; i ++) {
for (int j = 1; j <= (m - 1) / 2; j ++) {
a[i][j] = 0;
}
}
for (int i = n; i > n - (n / 2 + 1); i --) {
for (int j = m; j > m - ((m - 1) / 2); j --) {
a[i][j] = 0;
}
}
for (int i = 1; i <= n; i ++) {
for (int j = 1; j <= m; j ++) {
cout << (a[i][j] == 1 ? '+' : '-');
}
cout << endl;
}
}
else {
if (m == 1) {
for (int i = 1; i <= n; i ++) {
for (int j = 1; j <= m; j ++) {
cout << (a[i][j] == 1 ? '+' : '-');
}
cout << endl;
}
}
else {
for (int i = 1; i <= n; i ++) {
for (int j = 1; j <= m; j ++) {
cout << (a[i][j] == 1 ? '-' : '+');
}
cout << endl;
}
}
}
}
main () {
// freopen (".in", "r", stdin);
// freopen (".out", "w", stdout);
boost ();
int TT;
cin >> TT;
while (TT --) {
solve ();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
stones.cpp:81:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
81 | main () {
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |