Submission #220754

#TimeUsernameProblemLanguageResultExecution timeMemory
220754infinite_iqFriend (IOI14_friend)C++14
11 / 100
1089 ms3960 KiB
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) #include <bits/stdc++.h> using namespace std; #define sqr 200 #define mid (l+r)/2 #define pb push_back #define ppb pop_back #define fi first #define se second #define lb lower_bound #define ub upper_bound #define ins insert #define era erase #define C continue #define mem(dp,i) memset(dp,i,sizeof(dp)) #define mset multiset typedef long long ll; typedef short int si; typedef long double ld; typedef pair<int,int> pi; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pi> vpi; typedef vector<pll> vpll; const ll mod=1e9+7; const ll inf= 4e18; const ld pai=acos(-1); #include "friend.h" int adj[19][19]; int check(vi v){ for(int i=0;i<v.size();i++){ for(int j=i+1;j<v.size();j++){ int a=v[i]; int b=v[j]; if(adj[a][b])return 0; } } return 1; } int findSample(int n,int confidence[],int host[],int protocol[]){ for(int i=1;i<n;i++){ int t=protocol[i]; int j=host[i]; if(t==0){ adj[i][j]=adj[j][i]=1; C; } for(int k=0;k<n;k++){ if(adj[j][k])adj[i][k]=adj[k][i]=1; } if(t==2)adj[i][j]=adj[j][i]=1; } int ans=0; for(int mask=0;mask<(1<<n);mask++){ vi ret; int sum=0; for(int i=0;i<n;i++){ if( (mask&(1<<i)) ) ret.pb(i) , sum+=confidence[i]; } if(check(ret))ans=max(ans,sum); } return ans; }

Compilation message (stderr)

friend.cpp: In function 'int check(vi)':
friend.cpp:32:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i=0;i<v.size();i++){
                         ~^~~~~~~~~
friend.cpp:33:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                     for(int j=i+1;j<v.size();j++){
                                   ~^~~~~~~~~
#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...