제출 #448553

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4485532021-07-30 15:12:37FEDIKUS정렬하기 (IOI15_sorting)C++17
100 / 100
200 ms22568 KiB
#include "sorting.h"
#include<bits/stdc++.h>
#define xx first
#define yy second
using namespace std;
typedef pair<int,int> pii;
const int maxn=2e5+10;
int novi[maxn];
bool bio[maxn];
bool moze(int mid,int n,int m,int* s,int* x,int* y){
for(int i=0;i<n;i++) novi[i]=s[i];
for(int i=0;i<mid;i++){
swap(novi[x[i]],novi[y[i]]);
}
int klk=n;
for(int i=0;i<n;i++) bio[i]=false;
for(int i=0;i<n;i++){
if(bio[i]) continue;
klk--;
int tren=novi[i];
while(tren!=i){
bio[tren]=true;
tren=novi[tren];
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

sorting.cpp: In function 'bool moze(int, int, int, int*, int*, int*)':
sorting.cpp:16:29: warning: unused parameter 'm' [-Wunused-parameter]
   16 | bool moze(int mid,int n,int m,int* s,int* x,int* y){
      |                         ~~~~^
sorting.cpp: In function 'void swapovi(std::vector<int>, std::vector<std::pair<int, int> >&)':
sorting.cpp:36:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   36 |     for(int i=0;i<niz.size()-1;i++){
      |                 ~^~~~~~~~~~~~~
sorting.cpp: In function 'std::vector<std::pair<int, int> > popravi(int, int, int*, int*, int*, std::vector<std::pair<int, int> >)':
sorting.cpp:51:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   51 |         if(i<svi.size()){
      |            ~^~~~~~~~~~~
sorting.cpp: In function 'void nadji(int, int, int, int*, int*, int*, int*, int*)':
sorting.cpp:84:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   84 |     for(int i=0;i<res.size();i++){
      |                 ~^~~~~~~~~~~
sorting.cpp:63:30: warning: unused parameter 'm' [-Wunused-parameter]
   63 | void nadji(int naj,int n,int m,int* s,int* x,int* y,int* p,int* q){
      |                          ~~~~^
#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...