QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#376449 | #7680. Subway | arnold518 | WA | 1ms | 3792kb | C++17 | 1.4kb | 2024-04-04 10:11:45 | 2024-04-04 10:11:45 |
Judging History
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");
}
}
Details
Tip: Click on the bar to expand more detailed information
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]