Submission #198093

#TimeUsernameProblemLanguageResultExecution timeMemory
198093model_codeSecret Permutation (RMI19_permutation)C++17
3 / 100
5063 ms376 KiB
/** * user: savulescu-3de * fname: Ștefan * lname: Săvulescu * task: permutation * score: 3.0 * date: 2019-10-11 08:56:10.370654 */ #include "permutation.h" #include <bits/stdc++.h> bool f[15]; std::vector <int> a; void b (int poz,int N) { int i; if (poz==N) { int x=query(a); if (x==(N-1)) { std::vector <int> v1; for (i=1; i<=N; i++) v1.push_back(i); for (i=0; i<=(N-1); i++) v1[a[i]-1]=i+1; answer(v1); } } for (i=1; i<=N; i++) { if (f[i]==false) { f[i]=true; a.push_back(i); b(poz+1,N); f[i]=false; a.pop_back(); } } } void solve(int N) { int i,j,x,y,aux; std:: vector <int> v; for (i=1; i<=N; i++) v.push_back(i); b(0,N); return; }

Compilation message (stderr)

permutation.cpp: In function 'void solve(int)':
permutation.cpp:44:11: warning: unused variable 'j' [-Wunused-variable]
     int i,j,x,y,aux;
           ^
permutation.cpp:44:13: warning: unused variable 'x' [-Wunused-variable]
     int i,j,x,y,aux;
             ^
permutation.cpp:44:15: warning: unused variable 'y' [-Wunused-variable]
     int i,j,x,y,aux;
               ^
permutation.cpp:44:17: warning: unused variable 'aux' [-Wunused-variable]
     int i,j,x,y,aux;
                 ^~~
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...