이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#pragma warning (disable: 4996)
int N; vector<pair<int, int>> X;
int M; vector<pair<int, int>> Y;
int main() {
//FILE* in = freopen("in1.txt", "r", stdin);
//FILE* out = freopen("out1.txt", "w", stdout);
// ステップ 1. 入力
cin >> N; X.resize(N, make_pair(0, 0));
for (int i = 0; i < N; i++) cin >> X[i].first >> X[i].second;
cin >> M; Y.resize(M, make_pair(0, 0));
for (int i = 0; i < M; i++) cin >> Y[i].first >> Y[i].second;
// ステップ 2. 最大座標を求める
int ax = 0, ay = 0; for (int i = 0; i < N; i++) { ax = max(ax, X[i].first); ay = max(ay, X[i].second); }
int bx = 0, by = 0; for (int i = 0; i < M; i++) { bx = max(bx, Y[i].first); by = max(by, Y[i].second); }
// ステップ 3. 出力
cout << "scissors" << endl;
cout << "0 " << ax * ay << endl;
for (int i = 0; i < ax; i++) {
for (int j = 0; j < ay; j++) {
cout << 4 << " " << i << " " << j << " " << i + 1 << " " << j << " " << i + 1 << " " << j + 1 << " " << i << " " << j + 1 << endl;
}
}
cout << "tape" << endl;
cout << ax * ay; for (int i = 0; i < ax * ay; i++) cout << " " << i + 1; cout << endl;
for (int i = 0; i < bx; i++) {
for (int j = 0; j < by; j++) {
cout << 4 << " " << i << " " << j << " " << i + 1 << " " << j << " " << i + 1 << " " << j + 1 << " " << i << " " << j + 1 << endl;
}
}
cout << 4 << " " << 0 << " " << 0 << " " << bx << " " << 0 << " " << bx << " " << by << " " << 0 << " " << by << endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
scissors.cpp:5:0: warning: ignoring #pragma warning [-Wunknown-pragmas]
#pragma warning (disable: 4996)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |