Submission #707414

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7074142023-03-09 01:42:48EthanKim8683Bitaro’s Party (JOI18_bitaro)C++17
14 / 100
2009 ms66040 KiB
#include<bits/stdc++.h>
using namespace std;
using I=int;
const I N=100000;
const I MIN=-1e9;
vector<I>adjs1[N],adjs2[N];
set<I>viss;
vector<pair<I,I>>pres[N],tops[N];
set<I>curs;
I diss[N];
I tims[N];
I tim=1;
I dfs(I a){
if(tims[a]==tim)return diss[a];
tims[a]=tim,diss[a]=curs.count(a)?MIN:0;
for(auto b:adjs2[a])if(dfs(b)!=MIN)diss[a]=max(diss[a],diss[b]+1);
return diss[a];
}
I main(){
cin.tie(0)->sync_with_stdio(0);
I n,m,q;cin>>n>>m>>q;
for(I i=0;i<m;i++){
I s,e;cin>>s>>e,s--,e--;
adjs1[s].push_back(e),adjs2[e].push_back(s);
}
I siz=sqrt(n/log2(n))/7;
for(I i=0;i<n;i++){
pres[i].push_back({0,i});
sort(pres[i].begin(),pres[i].end());
viss.clear();
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'I main()':
bitaro.cpp:31:29: warning: comparison of integer expressions of different signedness: 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} and 'I' {aka 'int'} [-Wsign-compare]
   31 |     for(I j=0;tops[i].size()<siz&&j<pres[i].size();j++){
      |               ~~~~~~~~~~~~~~^~~~
bitaro.cpp:31:36: warning: comparison of integer expressions of different signedness: 'I' {aka 'int'} and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for(I j=0;tops[i].size()<siz&&j<pres[i].size();j++){
      |                                   ~^~~~~~~~~~~~~~~
bitaro.cpp:46:19: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'I' {aka 'int'} [-Wsign-compare]
   46 |     if(curs.size()<siz){printf("-1\n");continue;}
      |        ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...