This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
Compilation message (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... |