Submission #283341

#TimeUsernameProblemLanguageResultExecution timeMemory
283341stoyan_malininSorting (IOI15_sorting)C++14
0 / 100
1 ms640 KiB
#include "sorting.h" //#include "grader.cpp" #include <vector> #include <assert.h> #include <iostream> using namespace std; int guessSubtask(int m, int *x, int *y) { bool subtask2 = true; for(int i = 0;i<m;i++) { if(!(x[i]==0 && y[i]==0)) { subtask2 = false; break; } } if(subtask2==true) return 2; return -1; } int solve2(int n, int *s, int *p, int *q) { for(int i = 0;i<n;i++) { for(int j = i;j<n;j++) { if(s[j]==i) { swap(s[i], s[j]); p[i] = i; q[i] = j; break; } } } return n; } int findSwapPairs(int N, int S[], int M, int X[], int Y[], int P[], int Q[]) { int subtask = guessSubtask(M, X, Y); if(subtask==2) return solve2(N, S, P, Q); assert(false); } /* 4 3 2 1 0 5 0 1 0 0 0 0 0 0 0 0 */
#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...