Submission #1042986

#TimeUsernameProblemLanguageResultExecution timeMemory
1042986ALeonidouGondola (IOI14_gondola)C++17
25 / 100
7 ms2420 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define F first #define S second #define pb push_back #define endl "\n" #define sz(x) (ll)x.size() typedef vector <ll> vi; typedef pair <ll,ll> ii; typedef vector <ii> vii; #define dbg(x) cout<<#x<<": "<<x<<endl; #define dbg2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl; #define dbg3(x,y,z) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<" "<<#z<<": "<<z<<endl; void printVct(vi &v){ for (ll i =0; i<sz(v); i++){ cout<<v[i]<<" "; } cout<<endl; } //subtask 1 & 2 int valid(int n, int arr[]){ ll p = 0; while (p < n && arr[p] != 1) p++; vi v; for (ll i = p; i<n; i++){ v.pb(arr[i]); } for (ll i =0; i<p; i++){ v.pb(arr[i]); } for (ll i =1; i<n; i++){ if (v[i] != v[i-1] + 1){ return 0; } } return 1; } //---------------------- int replacement(int n, int arr[], int ans[]) { sort(arr, arr+n); ll ans_size = 0; ll c = 1; for (ll i=0; i<n; i++){ while (arr[i] > c){ ans[ans_size] = c; ans_size++; c++; } c++; } return ans_size; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } /* 1 5 1 2 3 4 5 */
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...