Submission #106419

#TimeUsernameProblemLanguageResultExecution timeMemory
106419DodgeBallManDetecting Molecules (IOI16_molecules)C++14
0 / 100
3 ms384 KiB
#include <bits/stdc++.h> #include "molecules.h" #define pii pair<int, int> #define x first #define y second using namespace std; vector<pii> v; vector<int> ans; int l, r; long long sum; vector<int> find_subset( int l, int u, vector<int> w ) { for( int i = 0 ; i < w.size() ; i++ ) v.emplace_back( pii( w[i], i ) ); sort( v.begin(), v.end() ); while( l < w.size() ) { while( r < w.size() && sum < l ) sum += ( long long ) v[r++].x; if( sum >- l && sum <= u ) { for( int i = l ; i <= r ; i++ ) ans.emplace_back( v[i].y ); return ans; } sum -= ( long long ) v[l++].x; } return {}; }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:15:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for( int i = 0 ; i < w.size() ; i++ ) v.emplace_back( pii( w[i], i ) );
                      ~~^~~~~~~~~~
molecules.cpp:17:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while( l < w.size() ) {
            ~~^~~~~~~~~~
molecules.cpp:18:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while( r < w.size() && sum < l ) sum += ( long long ) v[r++].x;
                ~~^~~~~~~~~~
#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...