Submission #259680

# Submission time Handle Problem Language Result Execution time Memory
259680 2020-08-08T09:10:53 Z errorgorn Secret Permutation (RMI19_permutation) C++14
3 / 100
3739 ms 256 KB
#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

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 time Memory Grader output
1 Partially correct 13 ms 256 KB Partially correct
2 Partially correct 0 ms 256 KB Partially correct
3 Partially correct 5 ms 256 KB Partially correct
4 Partially correct 9 ms 256 KB Partially correct
5 Partially correct 2 ms 256 KB Partially correct
6 Partially correct 1 ms 256 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 13 ms 256 KB Partially correct
2 Partially correct 0 ms 256 KB Partially correct
3 Partially correct 5 ms 256 KB Partially correct
4 Partially correct 9 ms 256 KB Partially correct
5 Partially correct 2 ms 256 KB Partially correct
6 Partially correct 1 ms 256 KB Partially correct
7 Execution timed out 3739 ms 256 KB Time limit exceeded (wall clock)
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 13 ms 256 KB Partially correct
2 Partially correct 0 ms 256 KB Partially correct
3 Partially correct 5 ms 256 KB Partially correct
4 Partially correct 9 ms 256 KB Partially correct
5 Partially correct 2 ms 256 KB Partially correct
6 Partially correct 1 ms 256 KB Partially correct
7 Execution timed out 3739 ms 256 KB Time limit exceeded (wall clock)
8 Halted 0 ms 0 KB -