QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#303959 | #7680. Subway | zhouhuanyi | WA | 1ms | 3632kb | C++14 | 1.2kb | 2024-01-13 09:13:58 | 2024-01-13 09:14:00 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 50
using namespace std;
const int inf=(int)(1e7);
int read()
{
char c=0;
int sum=0,f=1;
while (c!='-'&&(c<'0'||c>'9')) c=getchar();
if (c=='-') c=getchar(),f=-1;
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum*f;
}
struct reads
{
int x,y,a;
bool operator < (const reads &t)const
{
return x!=t.x?x<t.x:y<t.y;
}
};
reads st[N+1];
struct points
{
int x,y;
};
points tong[N+1];
int n,length,maxn;
int main()
{
n=read();
for (int i=1;i<=n;++i) st[i].x=read(),st[i].y=read(),st[i].a=read(),maxn=max(maxn,st[i].a);
if (n==1)
{
printf("%d\n",st[1].a);
for (int i=1;i<=st[1].a;++i) printf("2 %d %d %d %d\n",st[1].x,st[1].y,st[1].x+1,st[1].y+i);
}
else
{
sort(st+1,st+n+1),printf("%d\n",maxn);
for (int i=1;i<=maxn;++i)
{
length=0;
for (int j=1;j<=n;++j)
{
if (j!=1) tong[++length]=(points){i*(st[j-1].x+st[j].x+4000)-2000,i*(st[j-1].y+st[j].y+2*inf)-inf};
if (st[j].a>=i) tong[++length]=(points){st[j].x,st[j].y};
}
printf("%d ",length);
for (int j=1;j<=length;++j) printf("%d %d ",tong[j].x,tong[j].y);
puts("");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3632kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 5 1 2 2003 10000003 2 1 2005 10000004 3 3 4 6006 30000006 2 1 6010 30000008 3 3
result:
ok ok Sum L = 9
Test #2:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
1 1 1 1
output:
1 2 1 1 2 2
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
1 1 1 50
output:
50 2 1 1 2 2 2 1 1 2 3 2 1 1 2 4 2 1 1 2 5 2 1 1 2 6 2 1 1 2 7 2 1 1 2 8 2 1 1 2 9 2 1 1 2 10 2 1 1 2 11 2 1 1 2 12 2 1 1 2 13 2 1 1 2 14 2 1 1 2 15 2 1 1 2 16 2 1 1 2 17 2 1 1 2 18 2 1 1 2 19 2 1 1 2 20 2 1 1 2 21 2 1 1 2 22 2 1 1 2 23 2 1 1 2 24 2 1 1 2 25 2 1 1 2 26 2 1 1 2 27 2 1 1 2 28 2 1 1 2 ...
result:
ok ok Sum L = 100
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3568kb
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 99 -981 -193 74 10000189 -945 382 129 10001053 -926 671 186 10000004 -888 -667 227 9998558 -885 -775 245 9998528 -870 -697 305 9999684 -825 381 391 9999844 -784 -537 533 10000194 -683 731 649 10000006 -668 -725 753 9998838 -579 -437 863 10000388 -558 825 894 10000173 -548 -652 953 9999171 -499 -1...
result:
wrong answer Self-intersecting polyline 1.