Submission #502569

#TimeUsernameProblemLanguageResultExecution timeMemory
502569InternetPerson10Scissors and Tape (CEOI19_scissors)C++17
5 / 100
1118 ms549576 KiB
#include <bits/stdc++.h> using namespace std; void printShape(vector<int> shape) { cout << shape.size()/2; for(int g : shape) { cout << ' ' << g; } cout << '\n'; } vector<vector<int>> shapes; int currentId = 1; void scissors(int id, vector<vector<int>> subdivision) { cout << "scissors\n"; cout << id << ' ' << subdivision.size() << '\n'; for(vector<int> v : subdivision) { shapes.push_back(v); printShape(v); } } void tape(vector<int> ids, vector<vector<int>> subdivision, vector<int> finalShape) { cout << "tape\n"; cout << ids.size(); for(int id : ids) { cout << ' ' << id; } cout << '\n'; for(vector<int> v : subdivision) { printShape(v); } printShape(finalShape); } void solve(vector<int> initialShape, vector<int> finalShape) { vector<vector<int>> initialSquares, finalSquares; int initialWidth = initialShape[4]; int initialHeight = initialShape[5]; int finalWidth = finalShape[4]; int finalHeight = finalShape[5]; for(int i = 0; i < initialWidth; i++) { for(int j = 0; j < initialHeight; j++) { initialSquares.push_back(vector<int>()); initialSquares.back().push_back(i); initialSquares.back().push_back(j); initialSquares.back().push_back(i+1); initialSquares.back().push_back(j); initialSquares.back().push_back(i+1); initialSquares.back().push_back(j+1); initialSquares.back().push_back(i); initialSquares.back().push_back(j+1); } } for(int i = 0; i < finalWidth; i++) { for(int j = 0; j < finalHeight; j++) { finalSquares.push_back(vector<int>()); finalSquares.back().push_back(i); finalSquares.back().push_back(j); finalSquares.back().push_back(i+1); finalSquares.back().push_back(j); finalSquares.back().push_back(i+1); finalSquares.back().push_back(j+1); finalSquares.back().push_back(i); finalSquares.back().push_back(j+1); } } scissors(0, initialSquares); vector<int> ids; for(int i = 1; i <= initialWidth * initialHeight; i++) { ids.push_back(i); } tape(ids, finalSquares, finalShape); } int main() { int n; cin >> n; vector<int> initialShape(2*n); for(int i = 0; i < 2*n; i++) cin >> initialShape[i]; int m; cin >> m; vector<int> finalShape(2*m); for(int i = 0; i < 2*m; i++) cin >> finalShape[i]; shapes.push_back(initialShape); solve(initialShape, finalShape); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...