QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#239343#7680. Subwayucup-team2307#WA 1ms3592kbC++201.0kb2023-11-04 20:11:362023-11-04 20:11:38

Judging History

你现在查看的是最新测评结果

  • [2023-11-04 20:11:38]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3592kb
  • [2023-11-04 20:11:36]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define int ll

const int N=55,S=6000;

struct point
{
    int x,y,a;
};

bool operator<(point p,point q)
{
    return p.x+S*p.y<q.x+S*q.y;
}

point pts[N];
vector<pair<int,int>> ans[N];

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin>>n;
    int k=0;
    for(int i=1;i<=n;i++)
        cin>>pts[i].x>>pts[i].y>>pts[i].a,
        k=max(k,pts[i].a);
    sort(pts+1,pts+n+1);
    for(int i=1;i<=n;i++)
    {
        auto[x,y,a]=pts[i];
        int xy=x+S*y;
        for(int j=1;j<=a;j++)
            ans[j].emplace_back(x,y);
        for(int j=a+1;j<=k;j++)
            ans[j].emplace_back(xy%S+j*S,xy/S-j);
        xy+=S/2;
        for(int j=1;j<=k;j++)
            ans[j].emplace_back(xy%S+j*S,xy/S-j);
    }
    cout<<k<<"\n";
    for(int i=1;i<=k;i++)
    {
        cout<<ans[i].size()<<" ";
        for(auto[x,y]:ans[i])
            cout<<x<<" "<<y<<" ";
        cout<<"\n";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3592kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 9002 0 1 2 9001 1 3 3 9003 2 
6 2 1 15002 -1 12001 0 15001 0 3 3 15003 1 

result:

ok ok Sum L = 12

Test #2:

score: 0
Accepted
time: 1ms
memory: 3380kb

input:

1
1 1 1

output:

1
2 1 1 9001 0 

result:

ok ok Sum L = 2

Test #3:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

1
1 1 50

output:

50
2 1 1 9001 0 
2 1 1 15001 -1 
2 1 1 21001 -2 
2 1 1 27001 -3 
2 1 1 33001 -4 
2 1 1 39001 -5 
2 1 1 45001 -6 
2 1 1 51001 -7 
2 1 1 57001 -8 
2 1 1 63001 -9 
2 1 1 69001 -10 
2 1 1 75001 -11 
2 1 1 81001 -12 
2 1 1 87001 -13 
2 1 1 93001 -14 
2 1 1 99001 -15 
2 1 1 105001 -16 
2 1 1 111001 -17 
2...

result:

ok ok Sum L = 100

Test #4:

score: -100
Wrong Answer
time: 1ms
memory: 3540kb

input:

50
662 -567 48
728 -120 7
307 669 27
-885 -775 21
100 242 9
-784 -537 41
940 198 46
736 -551 30
-449 456 16
-945 382 18
-182 810 49
213 187 44
853 245 48
617 -305 19
-81 261 3
617 208 8
-548 -652 6
-888 -667 14
-371 -812 43
202 -702 10
-668 -725 5
961 -919 33
-870 -697 50
428 810 29
560 405 7
348 -3...

output:

50
100 961 -919 3961 -919 -306 -897 2694 -897 334 -893 3334 -893 -371 -812 2629 -812 -885 -775 2115 -775 -668 -725 2332 -725 -462 -719 2538 -719 202 -702 3202 -702 -870 -697 2130 -697 -888 -667 2112 -667 -548 -652 2452 -652 662 -567 3662 -567 736 -551 3736 -551 -784 -537 2216 -537 -579 -437 2421 -43...

result:

wrong answer Polyline 2 intersects with previous polylines.