QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#602586 | #7680. Subway | etherealUnicorn | WA | 1ms | 3712kb | C++14 | 1.2kb | 2024-10-01 10:58:15 | 2024-10-01 10:58:17 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 53;
const int nx = 10001;
const int ny = 2;
struct Station
{
int x, y;
int cnt;
int prex, prey;
};
Station st[N];
vector<int> tmp;
bool cmp(Station a, Station b) { return make_pair(a.x, a.y) < make_pair(b.x, b.y); }
int main()
{
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int n, maxcnt = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> st[i].x >> st[i].y >> st[i].cnt;
st[i].prex = st[i].x + 1 + ny * N;
st[i].prey = st[i].y - (nx / ny + 1) - nx * N;
maxcnt = max(maxcnt, st[i].cnt);
}
sort(st + 1, st + n + 1, cmp);
cout << maxcnt << endl;
for (; maxcnt > 0; maxcnt--)
{
tmp.clear();
for (int i = 1; i <= n; i++)
if (st[i].cnt == maxcnt)
tmp.push_back(i);
cout << 2 * tmp.size() << " ";
for (auto i : tmp)
{
st[i].cnt--;
cout << st[i].prex << " " << st[i].prey << " " << st[i].x << " " << st[i].y << " ";
st[i].prex -= ny;
st[i].prey += nx;
}
cout << endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 4 109 -535053 2 1 110 -535051 3 3 6 108 -535052 1 2 107 -525052 2 1 108 -525050 3 3
result:
ok ok Sum L = 10
Test #2:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
1 1 1 1
output:
1 2 108 -535053 1 1
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
1 1 1 50
output:
50 2 108 -535053 1 1 2 106 -525052 1 1 2 104 -515051 1 1 2 102 -505050 1 1 2 100 -495049 1 1 2 98 -485048 1 1 2 96 -475047 1 1 2 94 -465046 1 1 2 92 -455045 1 1 2 90 -445044 1 1 2 88 -435043 1 1 2 86 -425042 1 1 2 84 -415041 1 1 2 82 -405040 1 1 2 80 -395039 1 1 2 78 -385038 1 1 2 76...
result:
ok ok Sum L = 100
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 3628kb
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 4 -763 -535751 -870 -697 104 -535350 -3 -296 8 -765 -525750 -870 -697 -75 -534244 -182 810 102 -525349 -3 -296 242 -535241 135 -187 12 -767 -515749 -870 -697 -77 -524243 -182 810 100 -515348 -3 -296 240 -525240 135 -187 769 -535621 662 -567 960 -534809 853 245 14 -769 -505748 -870 -697 -79 -51...
result:
wrong answer Polyline 2 intersects with previous polylines.