QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#777900#9557. Temperancexcxc82#WA 1ms7740kbC++14764b2024-11-24 10:52:452024-11-24 10:52:47

Judging History

This is the latest submission verdict.

  • [2024-11-24 10:52:47]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 7740kb
  • [2024-11-24 10:52:45]
  • Submitted

answer

#include<bits/stdc++.h>
#define raed read
using namespace std;
const int MAXN = 200010,INF = 0x3f3f3f3f,mod = 1e9+7;
const double eps = 0.0001;
int n,m,T,sum[MAXN];
int a[MAXN],b[MAXN],c[MAXN]; 
int x[MAXN],y[MAXN],z[MAXN];
signed main(){
	cin>>T;
	while(T--){
		for(int i=1;i<=n;i++){
			sum[i] = 0;
			x[a[i]] = 0,y[b[i]] = 0,z[c[i]] = 0;
		}
		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>a[i]>>b[i]>>c[i];
			x[a[i]]++,y[b[i]]++,z[c[i]]++;
		}
		for(int i=1;i<=n;i++){
			int t = max({x[a[i]]-1,y[b[i]]-1,z[c[i]]-1});
			sum[t]++;
		}
		for(int i=1;i<=n;i++) sum[i]+=sum[i-1];
		cout<<0<<" ";
		for(int i=1;i<=n-1;i++) cout<<sum[i-1]<<" ";
		cout<<endl;
	}
}
/*
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
*/


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 7648kb

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: 1ms
memory: 7740kb

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 1 
0 1 1 
0 1 1 1 
0 1 1 2 6 
0 1 1 1 7 7 
0 1 1 1 8 8 8 
0 1 1 1 9 9 9 9 
0 
0 2 
0 2 2 
0 2 2 2 
0 2 2 3 7 
0 2 2 2 8 8 
0 2 2 2 9 9 9 
0 2 2 2 10 10 10 10 

result:

wrong answer 3rd numbers differ - expected: '0', found: '1'