제출 #993891

#제출 시각아이디문제언어결과실행 시간메모리
993891Lib9월 (APIO24_september)C++17
0 / 100
8 ms21340 KiB
#include <bits/stdc++.h> #include "september.h" using namespace std; long long xorhash[6]; vector <set <int> > ShitPar; long long RemChild[10][500003]; int solve(int n, int m, vector<int> Par, vector <vector<int> > Record){ int ans=0; for(int i=0;i<n;i++){ for(int k=0;k<5;k++){ RemChild[k][i]=0; } } for(int i=1;i<n;i++){ for(int k=0;k<m;k++){ RemChild[k][i]++; } } ShitPar.clear(); for(int i=0;i<5;i++){ xorhash[i]=463222221001217544; } int check1,check2; for(int i=n-2;i>=0;i--){ for(int k=0;k<m;k++){ RemChild[k][Par[Record[k][i]]]--; if(!RemChild[k][Par[Record[k][i]]]){ ShitPar[k].erase(Par[Record[k][i]]); } if(RemChild[k][Record[k][i]]){ ShitPar[k].insert(Record[k][i]); } } xorhash[m]=xorhash[m-1]; check1=0; check2=0; for(int k=0;k<m;k++){ check1|=int(ShitPar[k].size()); check2|=(xorhash[k]!=xorhash[k+1]); } if(!check1&&!check2){ ans++; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...