QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#883043#9557. TemperanceNimi_Sora#TL 53ms65924kbC++23927b2025-02-05 14:31:542025-02-05 14:31:54

Judging History

This is the latest submission verdict.

  • [2025-02-05 14:31:54]
  • Judged
  • Verdict: TL
  • Time: 53ms
  • Memory: 65924kb
  • [2025-02-05 14:31:54]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=1e6+7;
using pii=pair<int,int>;
#define fi first
#define se second
struct P{
    ll x,y,z;
};
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int tt=1;
    cin>>tt;
    while(tt--){
        ll n;cin>>n;
        vector<P>ve(N);
        vector<array<ll,3>>cnt(N);
        vector<ll>c(N),pre(N);
        for(int i=1;i<=n;i++){
            ll x,y,z;cin>>x>>y>>z;
            ve[i]={x,y,z};
            cnt[x][0]++,cnt[y][1]++,cnt[z][2]++;
        }
        for(int i=1;i<=n;i++){
            ll x=ve[i].x,y=ve[i].y,z=ve[i].z;
            c[i]=max(cnt[x][0],max(cnt[y][1],cnt[z][2]));
//            cout<<c[i]<<'x';
            pre[c[i]]++;
        }
        for(int i=1;i<=n;i++){
            pre[i]+=pre[i-1];
        }
        for(int i=0;i<n;i++)cout<<pre[i]<<' ';cout<<'\n';

    }
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 65776kb

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: 0
Accepted
time: 53ms
memory: 65924kb

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 0 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 0 7 7 7 
0 0 0 0 8 8 8 8 

result:

ok 72 numbers

Test #3:

score: -100
Time Limit Exceeded

input:

10000
22
1 4 4
7 2 6
6 5 4
4 4 1
1 7 1
7 6 6
5 8 6
4 4 8
6 7 6
1 7 3
5 7 8
5 1 3
2 1 7
1 2 5
6 1 2
3 1 1
7 3 8
1 4 6
6 5 7
4 4 7
7 7 5
3 4 6
13
2 7 3
2 7 5
5 1 5
8 7 1
6 6 7
3 5 8
8 1 6
4 8 4
1 4 3
6 2 5
6 8 4
1 5 5
5 3 4
28
4 7 2
3 8 5
1 1 6
1 7 4
5 5 6
6 1 5
4 5 2
1 1 5
2 6 3
4 3 6
4 5 7
3 3 6
6 8...

output:

0 0 0 0 7 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 
0 0 3 9 13 13 13 13 13 13 13 13 13 
0 0 0 0 8 21 21 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 
0 0 1 9 9 14 14 14 14 14 14 14 14 14 
0 0 0 6 9 12 12 19 19 19 19 19 19 19 19 19 19 19 19 
0 0 0 0 3 8 10 22 36 36 36 36 3...

result: