이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;
int id, X1, X2, Y1, Y2;
int nowx, nowy;
vector <pair <int, int>> points, require;
vector <vector <pair <int, int>>> shapes;
vector <int> idlist;
void scissors(int idA, vector <vector <pair <int, int>>> remains) {
cout << "scissors\n";
cout << idA << ' ' << remains.size() << '\n';
shapes.pop_back();
idlist.pop_back();
nowx = 0;
nowy = 0;
for(auto shape : remains) {
cout << shape.size() << ' ';
for(auto [x, y] : shape) {
cout << x << ' ' << y << ' ';
}
cout << '\n';
for(auto &[x, y] : shape) {
x -= nowx;
y += nowy;
}
idlist.push_back(++id);
shapes.push_back(shape);
nowx += X2;
nowy += Y1;
}
}
void tape() {
cout << "tape\n";
cout << shapes.size() << ' ';
for(auto i : idlist) {
cout << i << ' ';
}
cout << '\n';
for(auto shape : shapes) {
cout << shape.size() << ' ';
for(auto [x, y] : shape) {
cout << x << ' ' << y << ' ';
}
cout << '\n';
}
cout << require.size() << ' ';
for(auto [x, y] : require) {
cout << x << ' ' << y << ' ';
}
}
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int N;
cin >> N;
while(N--) {
int x, y;
cin >> x >> y;
points.emplace_back(x, y);
}
tie(X1, Y1) = points[2];
idlist.push_back(id);
shapes.push_back(points);
cin >> N;
while(N--) {
int x, y;
cin >> x >> y;
require.emplace_back(x, y);
}
tie(X2, Y2) = require[2];
assert(X1 > X2 and X1 * Y1 == X2 * Y2);
vector <vector <pair <int, int>>> remains;
remains.push_back({{0, 0}, {X2, 0}, {X2, Y1}, {0, Y1}});
nowx = X2;
while(X1 > X2) {
remains.push_back({{nowx, 0}, {nowx + X2, 0}, {nowx + X2, Y1}, {nowx, Y1}});
nowx += X2;
X1 -= X2;
}
if(remains.size() > 1) {
scissors(id, remains);
tape();
}
return 0;
}
# | 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... |