답안 #1095904

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1095904 2024-10-03T11:39:49 Z alexander707070 Scissors and Tape (CEOI19_scissors) C++14
0 / 100
1000 ms 111956 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1032 ms 103216 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1024 ms 99796 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1032 ms 103216 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1071 ms 111956 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1047 ms 110168 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1032 ms 103216 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1032 ms 103216 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1032 ms 103216 KB Time limit exceeded
2 Halted 0 ms 0 KB -