QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#799839#9557. TemperanceSword1E1RE 0ms3644kbC++201020b2024-12-05 18:41:422024-12-05 18:41:42

Judging History

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

  • [2024-12-05 18:41:42]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:3644kb
  • [2024-12-05 18:41:42]
  • 提交

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 + 5);
	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: 3644kb

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 ...

output:


result: