제출 #1011676

#제출 시각아이디문제언어결과실행 시간메모리
1011676irmuun정렬하기 (IOI15_sorting)C++17
20 / 100
1 ms348 KiB
#include<bits/stdc++.h>
#include "sorting.h"

using namespace std;

#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
    int r=0;
    while(true){
        bool found=false;
        for(int i=0;i<n;i++){
            if(S[i]!=i){
                found=true;
                P[r]=i;
                Q[r]=S[i];
                swap(S[P[r]],S[Q[r]]);
                r++;
                break;
            }
        }
        if(!found) break;
    }
    return r;
}

컴파일 시 표준 에러 (stderr) 메시지

sorting.cpp: In function 'int findSwapPairs(int, int*, int, int*, int*, int*, int*)':
sorting.cpp:13:39: warning: unused parameter 'm' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                   ~~~~^
sorting.cpp:13:46: warning: unused parameter 'X' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                          ~~~~^~~
sorting.cpp:13:55: warning: unused parameter 'Y' [-Wunused-parameter]
   13 | int findSwapPairs(int n, int S[], int m, int X[], int Y[], int P[], int Q[]){//P Q is answers
      |                                                   ~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...