QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#602664#7680. SubwayetherealUnicornWA 1ms3688kbC++141.4kb2024-10-01 11:42:312024-10-01 11:42:32

Judging History

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

  • [2024-10-01 11:42:32]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3688kb
  • [2024-10-01 11:42:31]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 53;
const int INF = 8e8;
const int nx = 10001;
const int ny = 2;
const int K = (INF / nx) / N;

struct Station
{
    ll x, y;
    int cnt;
    ll prex, prey;
    ll sufx, sufy;
};

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 * K * (n + 1 - i);
        st[i].prey = st[i].y - (nx / ny + 1) - nx * K * (n + 1 - i);
        st[i].sufx = st[i].sufy = 0;
        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;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3640kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
4 6039 -30188018 2 1 3022 -15096507 3 3 
6 9056 -45279526 1 2 6037 -30178017 2 1 3020 -15086506 3 3 

result:

ok ok Sum L = 10

Test #2:

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

input:

1
1 1 1

output:

1
2 3020 -15096509 1 1 

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
2 3020 -15096509 1 1 
2 3018 -15086508 1 1 
2 3016 -15076507 1 1 
2 3014 -15066506 1 1 
2 3012 -15056505 1 1 
2 3010 -15046504 1 1 
2 3008 -15036503 1 1 
2 3006 -15026502 1 1 
2 3004 -15016501 1 1 
2 3002 -15006500 1 1 
2 3000 -14996499 1 1 
2 2998 -14986498 1 1 
2 2996 -14976497 1 1 
2 2994 -149...

result:

ok ok Sum L = 100

Test #4:

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

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 83635 -422567950 -870 -697 51304 -256560950 -3 -296 
8 83633 -422557949 -870 -697 120539 -603664551 -182 810 51302 -256550949 -3 -296 12208 -60371224 135 -187 
12 83631 -422547948 -870 -697 120537 -603654550 -182 810 51300 -256540948 -3 -296 12206 -60361223 135 -187 151563 -754581018 662 -567 1...

result:

wrong answer Polyline 2 intersects with previous polylines.