QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#766816#9557. TemperanceWzyWA 0ms3748kbC++141012b2024-11-20 18:43:442024-11-20 18:43:46

Judging History

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

  • [2024-11-20 18:43:46]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3748kb
  • [2024-11-20 18:43:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef  long long LL;
typedef pair<int,int> PII;
const int N=1000010,M=2000010;
const int mod=998244353;
int INF = 1e9;
int h[N],e[M],ne[M],idx;
int T=1;
int st[N],primes[N],cnt;
struct nd
{
    int x,y,z;
};




void solve(){
   int n;
   cin>>n;
   map<int,int> mp[4];
   vector<nd> req(n);
   vector<int> c(n);

   for(int i=0;i<n;i++){
        int a,b,c;
        cin>>a>>b>>c;
        mp[1][a]++,mp[2][b]++,mp[3][c]++;


        req[i]={a,b,c};
   }


   for(auto [x,y,z]:req){
        int t=max(mp[1][x],mp[2][y]);
        t=max(t,mp[3][z])-1;


        c[t]++;
   }


   for(int i=0;i<n;i++){
        if(i==0) cout<<0<<" ";
        else{
            c[i]+=c[i-1];
            cout<<c[i]<<" ";
        }

   }
   cout<<endl;


   return ;
}

    
 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //int T=1;
    cin>>T;
    while(T--) solve();
 
    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3748kb

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 2 5 5 5 
0 3 3 

result:

wrong answer 2nd numbers differ - expected: '0', found: '2'