QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#602661#7680. SubwayetherealUnicornWA 0ms3632kbC++141.4kb2024-10-01 11:41:342024-10-01 11:41:34

Judging History

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

  • [2024-10-01 11:41:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-10-01 11:41:34]
  • 提交

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 - 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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3632kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
4 3021 -30188018 2 1 4 -15096507 3 3 
6 6038 -45279526 1 2 3019 -30178017 2 1 2 -15086506 3 3 

result:

wrong answer Self-intersecting polyline 1.