QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#425658 | #8724. September | sidekick257 | Compile Error | / | / | C++98 | 1.2kb | 2024-05-30 15:24:19 | 2024-05-30 15:24:19 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+4;
int sz[N],t[N],ans;
bool bj[N];
int solve(int n,int m,vector<int> f,vector<vector<int>> s){
ans=0;
for(int i=0;i<=n;i++) sz[i]=0,t[i]=0,bj[i]=0;
n--;
for(int i=0;i<n;i++) sz[f[i]]++;
int cnt=0,last=-1,ccnt=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
t[s[j][i]]++;
if(t[s[j][i]]==1) cnt++;
if(t[s[j][i]]==m) cnt--;
}
if(cnt==0){
for(int j=last+1;j<=i;j++){
bj[s[0][j]]=1;
if(sz[s[0][j]]) ccnt++;
sz[f[s[0][j]-1]]--;
if(sz[f[s[0][j]-1]]==0&&bj[f[s[0][j]-1]]) ccnt--;
}
if(ccnt==0) ans++;
last=i;
}
}
// cout<<ans;
return ans;
}
// int main(){
// int n;
// int m,x;
// vector<int> f;
// vector<vector<int>> s;
// vector<int> c;
// cin>>n>>m;
// for(int i=1;i<n;i++) cin>>x,f.push_back(x);
// for(int j=1;j<=m;j++){
// for(int i=1;i<n;i++)cin>>x,c.push_back(x);
// s.push_back(c);
// c.clear();
// }
// solve(n,m,f,s);
// return 0;
// }
Details
In file included from implementer.cpp:1: september.h:3:72: error: ‘>>’ should be ‘> >’ within a nested template argument list 3 | int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S); | ^~ | > > implementer.cpp: In function ‘int mtbpdhr2zxjo1o4i9oreohsbuzzl4s6u::taskcase()’: implementer.cpp:14:44: error: ‘>>’ should be ‘> >’ within a nested template argument list 14 | std::vector<std::vector<int>> S(M, std::vector<int>(N - 1)); | ^~ | > > implementer.cpp: In function ‘int mtbpdhr2zxjo1o4i9oreohsbuzzl4s6u::mian()’: implementer.cpp:21:64: error: ‘nullptr’ was not declared in this scope 21 | std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullptr); | ^~~~~~~ implementer.cpp:27:25: error: ‘exit’ was not declared in this scope 27 | exit(0); | ^~~~ implementer.cpp:4:1: note: ‘exit’ is defined in header ‘<cstdlib>’; did you forget to ‘#include <cstdlib>’? 3 | #include <iostream> +++ |+#include <cstdlib> 4 | #include <string> answer.code:6:54: error: ‘>>’ should be ‘> >’ within a nested template argument list 6 | int solve(int n,int m,vector<int> f,vector<vector<int>> s){ | ^~ | > >