답안 #690862

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
690862 2023-01-30T13:17:42 Z Nuraly_Serikbay Red-blue table (IZhO19_stones) C++14
10 / 100
26 ms 1312 KB
/* 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 << max (0ll, n - 2) + 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 << max (0ll, m - 2) + 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);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB in the table A+B is not equal to 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 328 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB in the table A+B is not equal to 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 1256 KB in the table A+B is not equal to 116
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 26 ms 1312 KB in the table A+B is not equal to 46
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB in the table A+B is not equal to 6
3 Halted 0 ms 0 KB -