QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#376449#7680. Subwayarnold518WA 1ms3792kbC++171.4kb2024-04-04 10:11:452024-04-04 10:11:45

Judging History

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

  • [2024-04-04 10:11:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3792kb
  • [2024-04-04 10:11:45]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 50;
const int P = 1e3;
const int Q = 1e9-1e4;

struct Data
{
    int x, y, k;
};

int N, K;
Data A[MAXN+10];
int B;

int main()
{
    scanf("%d", &N);
    for(int i=1; i<=N; i++) scanf("%d%d%d", &A[i].x, &A[i].y, &A[i].k), K=max(K, A[i].k);

    vector<int> V;
    for(int i=1; i<=N; i++) for(int j=i+1; j<=N; j++)
    {
        int x1=A[i].x, y1=A[i].y, x2=A[i].x, y2=A[i].y;
        if(x1==x2) continue;
        if(((y2-y1)*(-3*P-x1))%(x2-x1)==0)
        {
            int y=(y2-y1)*(-3*P-x1)/(x2-x1)+y1;
            if(-P<=y && y<=P) V.push_back(y);
        }
    }
    sort(V.begin(), V.end());
    for(int i=0; i<P; i++)
    {
        if(!binary_search(V.begin(), V.end(), i)) { B=i; break; }
        if(!binary_search(V.begin(), V.end(), -i)) { B=-i; break; }
    }

    for(int i=1; i<=K; i++)
    {
        vector<int> V;
        for(int j=1; j<=N; j++)
        {
            if(A[j].k>=i)
            {
                int y=(ll)(A[j].y-B)*(Q+i-(-3*P))/(A[j].x-(-3*P))+B;
                V.push_back(y);
                V.push_back(y+1);
            }
        }
        sort(V.begin(), V.end());
        printf("%d ", V.size());
        for(auto it : V) printf("%d %d ", Q+i, it);
        printf("\n");
    }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3792kb

input:

3
1 2 1
2 1 2
3 3 2

output:

6 999990001 333108 999990001 333109 999990001 666439 999990001 666440 999990001 998994 999990001 998995 
4 999990002 333108 999990002 333109 999990002 998994 999990002 998995 

result:

wrong answer Integer parameter [name=L] equals to 999990001, violates the range [2, 10000]