QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#799837 | #9557. Temperance | Sword1E1 | RE | 0ms | 3584kb | C++20 | 1020b | 2024-12-05 18:41:10 | 2024-12-05 18:41:10 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define dbg(x...) \
do { \
std::cout << #x << " -> "; \
err(x); \
} while (0)
void err() {
std::cout << std::endl;
}
template<class T, class... Ts>
void err(T arg, Ts &... args) {
std::cout << fixed << setprecision(10) << arg << ' ';
err(args...);
}
void GENSHEN_START() {
int n;cin >> n;
vector <array <int,3>> a(n + 1);
vector <int> cntx(n + 1),cnty(n + 1),cntz(n + 1);
for (int i = 1;i <= n;i++) {
cin >> a[i][0] >> a[i][1] >> a[i][2];
cntx[a[i][0]]++;
cnty[a[i][1]]++;
cntz[a[i][2]]++;
}
vector <int> pre(n + 1);
for (int i = 1;i <= n;i++) {
int mx = max({cntx[a[i][0]],cnty[a[i][1]],cntz[a[i][2]]});
pre[mx + 1]++;
}
for (int i = 1;i <= n;i++) {
pre[i] += pre[i - 1];
}
for (int i = 1;i <= n;i++) cout << pre[i] << ' ';
cout << '\n';
}
signed main()
{
ios::sync_with_stdio(false);cin.tie(nullptr);
int T = 1;
cin >> T;
while (T--) GENSHEN_START();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
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
Runtime Error
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 ...