QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#774873 | #9557. Temperance | hela_yht# | WA | 0ms | 8436kb | C++20 | 1.2kb | 2024-11-23 14:06:59 | 2024-11-23 14:06:59 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define int ll
typedef pair<int, int> PII;
const int N = 2e5 + 5, INF = 0x3f3f3f3f;
struct Node
{
int x, y, z;
int numx = 0, numy = 0, numz = 0;
};
void solve()
{
int n;
cin >> n;
vector<int> X(N), Y(N), Z(N);
vector<Node> a(n+1);
for (int i = 1; i <= n; i++)
{
cin >> a[i].x >> a[i].y >> a[i].z;
X[a[i].x]++;
Y[a[i].y]++;
Z[a[i].z]++;
}
for (int i = 1; i <= n; i++)
{
a[i].numx = X[a[i].x] - 1;
a[i].numy = Y[a[i].y] - 1;
a[i].numz = Z[a[i].y] - 1;
}
vector<int> D;
for (int i = 1; i <= n; i++)
{
D.push_back(max(max(a[i].numx, a[i].numy), a[i].numz));
}
vector<int> E(n + 10);
for (int i = 0; i < n; i++)
{
E[D[i]+1]++;
}
for (int i = 1; i <= n; i++)
E[i] += E[i - 1];
for (int i = 0; i < n; i++)
{
// cout << "----" << endl;
cout << E[i] << " ";
}
cout << endl;
}
signed main()
{
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int _ = 1;
cin >> _;
while (_--)
solve();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 8436kb
input:
2 5 1 1 1 1 1 2 1 1 3 2 3 5 2 2 4 3 1 1 1 2 2 2 3 3 3
output:
0 0 2 5 5 0 3 3
result:
ok 8 numbers
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 8288kb
input:
16 1 1 1 1 2 1 1 1 1 1 100000 3 1 1 1 1 1 100000 1 100000 1 4 1 1 1 1 1 100000 1 100000 1 1 100000 100000 5 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 6 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 100000 1 100000 7 1 1 1 1 1 100000 1 100000 1 1 100000 100000 100000 1 1 100000 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 6 6 0 0 0 1 7 7 7 0 0 0 0 8 8 8 8 0 0 0 0 0 0 0 0 0 0 0 0 0 1 5 0 0 0 0 6 6 0 0 0 1 7 7 7 0 0 0 0 8 8 8 8
result:
wrong answer 25th numbers differ - expected: '0', found: '1'