Submission #259680

#TimeUsernameProblemLanguageResultExecution timeMemory
259680errorgornSecret Permutation (RMI19_permutation)C++14
3 / 100
3739 ms256 KiB
#include "permutation.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define ii pair<ll,ll> #define iii pair<ii,ll> #define fi first #define se second #define endl '\n' #define debug(x) cout << #x << " is " << x << endl; #define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--)) #define all(x) (x).begin(),(x).end() #define sz(x) (int)(x).size() void solve(int n) { vector<int> v,ans(n); rep(x,1,n+1) v.push_back(x); do{ if (query(v)==n-1){ rep(x,0,n) ans[v[x]-1]=x+1; //rep(x,0,n) cout<<ans[x]<<" "; cout<<endl; answer(ans); return; } } while (next_permutation(all(v))); }

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...