Submission #26171

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
261712017-06-28 08:00:38ruhanhabib39Carnival (CEOI14_carnival)C++14
100 / 100
16 ms2020 KiB
#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> gp;
int res[150 + 10];
int query(vector<int> v) {
printf("%d", (int)v.size());
for(int i : v) {
printf(" %d", i);
}
printf("\n"); fflush(stdout);
int k; scanf("%d", &k);
return k;
}
int main() {
scanf("%d", &N);
gp.push_back(1);
for(int i = 2; i <= N; i++) {
gp.push_back(i);
if(query(gp) != gp.size()) {
gp.pop_back();
}
}
for(int i = 0; i < (int)gp.size(); i++) {
res[gp[i]] = i+1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:24:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if(query(gp) != gp.size()) {
                    ^
carnival.cpp:38:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          if(query(q) < q.size()) hi = m;
                      ^
carnival.cpp: In function 'int query(std::vector<int>)':
carnival.cpp:15:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    int k; scanf("%d", &k);
                          ^
carnival.cpp: In function 'int main()':
carnival.cpp:20:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d", &N);
                   ^
#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...