Submission #1095904

#TimeUsernameProblemLanguageResultExecution timeMemory
1095904alexander707070Scissors and Tape (CEOI19_scissors)C++14
0 / 100
1071 ms111956 KiB
#include<bits/stdc++.h> #define MAXN 600007 using namespace std; struct point{ int x,y; }p[10],q[10]; int n,m,al,bl,aw,bw; void solve(int id,int ax,int ay,int al,int aw,int bx,int by,int bl,int bw){ if(al==bl and aw==bw)return; if(al>bl){ swap(al,bl); swap(aw,bw); swap(ax,bx); swap(ay,by); } int k=aw/bw+(aw%bw!=0); cout<<"scissors\n"; cout<<id<<" "<<k<<"\n"; for(int i=0;i<k;i++){ if(i<k-1 or (aw%bw==0))cout<<ax<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+(i+1)*bw<<" "<<ax<<" "<<ay+(i+1)*bw<<"\n"; else{ cout<<ax<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+aw<<" "<<ax<<" "<<ay+aw<<"\n"; } } cout<<"tape\n"; if(aw%bw==0){ cout<<k<<" "; for(int i=1;i<=k;i++)cout<<id+i<<" "; cout<<"\n"; for(int i=0;i<k;i++){ cout<<bx+i*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by+bw<<" "<<bx+i*al<<" "<<by+bw<<"\n"; } return; }else{ cout<<k-1<<" "; for(int i=1;i<=k-1;i++)cout<<id+i<<" "; cout<<"\n"; for(int i=0;i<k-1;i++){ cout<<bx+i*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by+bw<<" "<<bx+i*al<<" "<<by+bw<<"\n"; } solve(id+k,ax+bw*k,ay,al,aw-bw*k , bx+k*al,by,bl-k*al,bw); return; } } int main(){ cin>>n; for(int i=1;i<=n;i++){ cin>>p[i].x>>p[i].y; } al=p[2].x-p[1].x; aw=p[3].y-p[2].y; cin>>m; for(int i=1;i<=m;i++){ cin>>q[i].x>>q[i].y; } bl=q[2].x-q[1].x; bw=q[3].y-q[2].y; solve(0,0,0,al,aw,0,0,bl,bw); return 0; }
#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...