| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1321354 | nikaa123 | Gondola (IOI14_gondola) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
int valid(int n, int inputSeq[]){
vector <int> s;
for (int i = 0; i < n; i++) {
if (inputSeq[i] <= n) {
s.push_back(inputSeq[i]);
}
}
int cnt = 0;
for (int i = 1; i < (s).size(); i++) {
if (s[i] < s[i-1]) cnt++;
}
return (cnt <= 1);
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return 1;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return 1;
}
