제출 #991795

#제출 시각아이디문제언어결과실행 시간메모리
991795simona1230Bitaro’s Party (JOI18_bitaro)C++17
14 / 100
39 ms10068 KiB
#include <bits/stdc++.h> using namespace std; void speed() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } long long n,m,q; vector<long long> v[100005]; void read() { cin>>n>>m>>q; for(long long i=1;i<=m;i++) { long long x,y; cin>>x>>y; v[x].push_back(y); } } long long t,k,b[100005],ans=-1; long long dp[100005]; void solve() { cin>>t>>k; for(long long i=1;i<=k;i++) { long long x; cin>>x; b[x]=1; } for(long long i=1;i<=n;i++) dp[i]=-1; for(long long i=1;i<=n;i++) { if(!b[i])dp[i]=max(1LL*0,dp[i]); for(long long j=0;j<v[i].size();j++) { long long nb=v[i][j]; if(dp[i]!=-1)dp[nb]=max(dp[nb],dp[i]+1); } //cout<<dp[i]<<endl; } cout<<dp[t]<<endl; } int main() { speed(); read(); solve(); return 0; } /* 12 17 10 1 2 2 3 3 4 1 5 2 6 3 7 4 8 5 6 6 7 7 8 5 9 6 10 7 11 8 12 9 10 10 11 11 12 3 7 1 2 3 4 5 6 7 */

컴파일 시 표준 에러 (stderr) 메시지

bitaro.cpp: In function 'void solve()':
bitaro.cpp:43:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |         for(long long j=0;j<v[i].size();j++)
      |                           ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...