Submission #47857

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
478572018-05-08 09:18:06mirbek01Library (JOI18_library)C++17
100 / 100
515 ms656 KiB
#include <cstdio>
#include <vector>
#include "library.h"
using namespace std;
void Solve(int N){
vector <int> res(N), M(N), used(N), a(N), b(N);
int cur = 0, p1 = 0;
a[0] = 0;
b[0] = 0;
used[0] = 1;
while(1){
vector <int> v;
for(int i = 0; i < N; i ++)
if(!used[i])
v.emplace_back(i);
if(!v.size()) break;
for(int i = 0; i < v.size(); i ++)
M[v[i]] = 1;
int A = Query(M);
M[cur] = 1;
int B = Query(M);
M[cur] = 0;
for(int i = 0; i < v.size(); i ++)
M[v[i]] = 0;
if(A < B) break;
int lo = 0, hi = v.size() - 1, rs;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

library.cpp: In function 'void Solve(int)':
library.cpp:19:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i = 0; i < v.size(); i ++)
                            ~~^~~~~~~~~~
library.cpp:25:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i = 0; i < v.size(); i ++)
                            ~~^~~~~~~~~~
library.cpp:60:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i = 0; i < v.size(); i ++)
                            ~~^~~~~~~~~~
library.cpp:66:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for(int i = 0; i < v.size(); i ++)
                            ~~^~~~~~~~~~
library.cpp:89:21: warning: 'rs' may be used uninitialized in this function [-Wmaybe-uninitialized]
             used[cur] = 1;
                     ^
library.cpp:48:21: warning: 'rs' may be used uninitialized in this function [-Wmaybe-uninitialized]
             used[cur] = 1;
                     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...