Submission #934882

#TimeUsernameProblemLanguageResultExecution timeMemory
934882irmuunPolitical Development (BOI17_politicaldevelopment)C++17
16 / 100
282 ms524288 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define ff first #define ss second #define all(s) s.begin(),s.end() #define rall(s) s.rbegin(),s.rend() int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,k; cin>>n>>k; ll d[n]; vector<ll>adj[n]; bool ok=false; bool dis[n][n]; memset(dis,0,sizeof dis); for(ll i=0;i<n;i++){ cin>>d[i]; if(d[i]>0) ok=true; adj[i].resize(d[i]); for(ll j=0;j<d[i];j++){ cin>>adj[i][j]; dis[i][adj[i][j]]=true; } } bool k3=false; for(ll i=0;i<n;i++){ for(ll j=0;j<adj[i].size();j++){ for(ll r=j+1;r<adj[i].size();r++){ if(dis[adj[i][j]][adj[i][r]]==true){ k3=true; } } } } if(k3){ cout<<3; } else if(ok){ cout<<2; } else{ cout<<1; } }

Compilation message (stderr)

politicaldevelopment.cpp: In function 'int main()':
politicaldevelopment.cpp:32:21: 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]
   32 |         for(ll j=0;j<adj[i].size();j++){
      |                    ~^~~~~~~~~~~~~~
politicaldevelopment.cpp:33:27: 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]
   33 |             for(ll r=j+1;r<adj[i].size();r++){
      |                          ~^~~~~~~~~~~~~~
#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...