Submission #238863

#TimeUsernameProblemLanguageResultExecution timeMemory
238863SortingSecret Permutation (RMI19_permutation)C++14
3 / 100
3431 ms384 KiB
#include <bits/stdc++.h> #include "permutationc.h" using namespace std; int query(int v[]); int query(vector<int> v); void answer(int v[]); void answer(vector<int> v); void solve(int n){ vector<int> v; for(int i = 1; i <= n; ++i) v.push_back(i); do{ if(query(v) == n - 1){ vector<int> p(n); for(int i = 0; i < n; ++i) p[v[i] - 1] = i + 1; answer(p); return; } } while(next_permutation(v.begin(), v.end())); }

Compilation message (stderr)

stub.cpp: In function 'int query(int*)':
stub.cpp:15:9: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   fscanf(stdin, "%d", &x);
   ~~~~~~^~~~~~~~~~~~~~~~~
stub.cpp: In function 'int main(int, char**)':
stub.cpp:48:9: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   fscanf(stdin, "%d", &N);
   ~~~~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...