QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602595#7680. SubwayetherealUnicornWA 1ms3708kbC++141.3kb2024-10-01 11:05:012024-10-01 11:05:03

Judging History

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

  • [2024-10-01 11:05:03]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3708kb
  • [2024-10-01 11:05:01]
  • 提交

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;
        maxcnt = max(maxcnt, st[i].cnt);
    }
    sort(st + 1, st + n + 1, cmp);
    for (int i = 1; i <= n; i++)
    {
        st[i].prex = st[i].x + 1 + ny * N * (N - i);
        st[i].prey = st[i].y - (nx / ny + 1) - nx * N * (N - i);
    }
    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: 3560kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
4 5409 -27037703 2 1 5304 -26507648 3 3 
6 5514 -27567755 1 2 5407 -27027702 2 1 5302 -26497647 3 3 

result:

ok ok Sum L = 10

Test #2:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

1
1 1 1

output:

1
2 5514 -27567756 1 1 

result:

ok ok Sum L = 2

Test #3:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

1
1 1 50

output:

50
2 5514 -27567756 1 1 
2 5512 -27557755 1 1 
2 5510 -27547754 1 1 
2 5508 -27537753 1 1 
2 5506 -27527752 1 1 
2 5504 -27517751 1 1 
2 5502 -27507750 1 1 
2 5500 -27497749 1 1 
2 5498 -27487748 1 1 
2 5496 -27477747 1 1 
2 5494 -27467746 1 1 
2 5492 -27457745 1 1 
2 5490 -27447744 1 1 
2 5488 -274...

result:

ok ok Sum L = 100

Test #4:

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

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 4113 -24918189 -870 -697 2754 -13786675 -3 -296 
8 4111 -24908188 -870 -697 3105 -16435834 -182 810 2752 -13776674 -3 -296 2680 -12726460 135 -187 
12 4109 -24898187 -870 -697 3103 -16425833 -182 810 2750 -13766673 -3 -296 2678 -12716459 135 -187 1829 -5836151 662 -567 1490 -3185074 853 245 
14...

result:

wrong answer Polyline 2 intersects with previous polylines.