Submission #262254

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2622542020-08-12 14:36:10youssefbou62Wiring (IOI17_wiring)C++14
0 / 100
20 ms19456 KiB
#include "wiring.h"
#include <bits/stdc++.h>
#define sz(x) (int)x.size()
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define fi first
#define se second
using namespace std;
const int MAXN = 2e5+1 ;
ll dp[MAXN][20];
vector<int> adj[MAXN],adj1[MAXN];
void mins(ll& a ,ll b ){
a = min ( a , b ) ;
}
long long min_total_length(vector<int> r, vector<int> b) {
int R = sz(r) , B = sz(b) ;
ll ans = 1e18 ;
for(int i = 0 ; i <= R ; i++ )for(int j = 0 ; j <= 19 ; j++ )dp[i][j] = 1e18;
vector<pair<int,int>> connections;
for(int i = 0 ; i < R ; i++ ){
connections.pb({r[i],-i-1});
}
for(int i = 0 ; i < B ; i++ ){
connections.pb({b[i],i+1});
}
sort(all(connections));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

wiring.cpp: In function 'long long int min_total_length(std::vector<int>, std::vector<int>)':
wiring.cpp:67:9: warning: unused variable 'in' [-Wunused-variable]
   67 |     int in = find(all(adj[x]),adj[i][j])-adj[x].begin() ;
      |         ^~
wiring.cpp:21:5: warning: unused variable 'ans' [-Wunused-variable]
   21 |  ll ans = 1e18 ;
      |     ^~~
#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...