답안 #238858

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
238858 2020-06-13T09:39:07 Z Sorting Secret Permutation (RMI19_permutation) C++14
0 / 100
15 ms 256 KB
#include <bits/stdc++.h>
//#include "permutation.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]] = i + 1;

            answer(v);
            return;
        }
    }
    while(next_permutation(v.begin(), v.end()));
}

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);
   ~~~~~~^~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -