Submission #238379

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2383792020-06-10 23:38:20oscarsierra12Friend (IOI14_friend)C++14
58 / 100
76 ms12152 KiB
#include "friend.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std ;
// Find out best sample
const int N = 100010 ;
int confi[N] ;
int dp [N][2];
vector <int> G[N][3] ;
int go ( int u, int flag ) {
auto &rf = dp[u][flag];
if ( rf!=-1 ) return rf ;
if ( flag ) {
///take
int x = confi[u] ;
for ( auto v:G[u][0] ) x += go( v, 0 ) ;
for ( auto v:G[u][2] ) x += go( v, 0 ) ;
for ( auto v:G[u][1] ) x += go( v, 1 ) ;
rf = x ;
///dont take
x = 0 ;
int it1 = 0, it2 = 0, it3 = 0, rep3 = 0, ini= 0, rep = 0, repp = 0,repp2= 0,rep2 =0 ;
for ( auto v:G[u][0] ) rep += go(v, 1), repp += go(v,0) ;
for ( auto v:G[u][1] ) rep2 += go(v, 0) ;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

friend.cpp: In function 'int go(int, int)':
friend.cpp:34:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while ( it1 < G[u][0].size() ) {
                 ~~~~^~~~~~~~~~~~~~~~
friend.cpp:35:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             while ( it2 < G[u][1].size() && G[u][1][it2] < G[u][0][it1] ) {
                     ~~~~^~~~~~~~~~~~~~~~
friend.cpp:40:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             while ( it3 < G[u][2].size() && G[u][2][it3] < G[u][0][it1] ) {
                     ~~~~^~~~~~~~~~~~~~~~
#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...