QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#767167#9557. TemperancehuangxiWA 1ms5844kbC++201.2kb2024-11-20 20:01:252024-11-20 20:01:27

Judging History

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

  • [2024-11-20 20:01:27]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:5844kb
  • [2024-11-20 20:01:25]
  • 提交

answer

#include<bits/stdc++.h>
#define ls p*2
#define rs p*2+1
#define x first
#define y second
#define endl '\n'
using namespace std;

mt19937 rnd(time(0));
typedef long long LL;
typedef unsigned long long  uLL;
typedef pair<LL,LL>PII;
typedef pair<double,double>PDD;
const double PI=acos(-1);
const int N=1e5+10,M=2e5+10,MOD=998244353,INF=1e9;
int n;
int T;
array<int,3>f[N];
int num[3][N];
int de[N];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>T;
    while(T--){
        cin>>n;
        for(int i=1;i<=n;i++){
            cin>>f[i][0]>>f[i][1]>>f[i][2];
            num[0][f[i][0]]++;
            num[1][f[i][1]]++;
            num[2][f[i][2]]++;
        }
        for(int i=1;i<=n;i++){
            int cur=max(num[0][f[i][0]],max(num[1][f[i][1]],num[2][f[i][2]]));
            de[cur]++;
        }
        for(int i=1;i<n;i++){
            de[i]+=de[i-1];
        }
        for(int i=0;i<n;i++){
            cout<<de[i]<<' ';

        }
        for(int i=0;i<=n;i++){
            for(int j=0;j<3;j++){
                num[j][i]=0;
            }
            de[i]=0;
        }
        cout<<endl;
    }


}






详细

Test #1:

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

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: 5844kb

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 2 
0 0 0 0 2 2 
0 0 0 0 1 1 2 
0 0 0 0 1 1 1 1 
0 
0 0 
0 0 0 
0 0 0 0 
0 0 0 0 1 
0 0 0 0 1 1 
0 0 0 0 1 1 1 
0 0 0 0 1 1 1 1 

result:

wrong answer 15th numbers differ - expected: '5', found: '2'