# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827358 | 2023-08-16T11:48:16 Z | vjudge1 | Zalmoxis (BOI18_zalmoxis) | C++17 | 129 ms | 59256 KB |
#include <bits/stdc++.h> using namespace std; //#define int long long #define OYY 1000000005 #define mod 1000000007 #define mid (start+end)/2 #define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int dizi[1000005],n,k,i=0; vector <int> cev; inline void solve(int a){ if(cev.size()==n+k){ return ; } if(cev.size()>=n){ if(n+k-cev.size()==1)cev.push_back(a); else cev.push_back(a-1); if(cev.size()<n+k)solve(a-1); return; } if(dizi[i]>a){ cev.push_back(a); solve(a); } else if(dizi[i]==a){ cev.push_back(a); i++; } else{ solve(a-1),solve(a-1); return ; } } int main(){ faster cin>>n>>k; for(int i=0;i<n;i++)cin>>dizi[i]; solve(30); /////// for (int i=0;i<cev.size();i++)cout<<cev[i]<<" "; cout<<'\n'; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 104 ms | 10256 KB | Output is correct |
2 | Correct | 110 ms | 10264 KB | Output is correct |
3 | Correct | 120 ms | 10276 KB | Output is correct |
4 | Correct | 101 ms | 10316 KB | Output is correct |
5 | Correct | 101 ms | 10280 KB | Output is correct |
6 | Correct | 105 ms | 10304 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 124 ms | 58168 KB | doesn't contain S as a subsequence |
2 | Incorrect | 125 ms | 58184 KB | doesn't contain S as a subsequence |
3 | Incorrect | 120 ms | 57092 KB | doesn't contain S as a subsequence |
4 | Incorrect | 121 ms | 58144 KB | doesn't contain S as a subsequence |
5 | Incorrect | 121 ms | 58168 KB | doesn't contain S as a subsequence |
6 | Incorrect | 123 ms | 58188 KB | doesn't contain S as a subsequence |
7 | Incorrect | 129 ms | 58232 KB | doesn't contain S as a subsequence |
8 | Incorrect | 122 ms | 58048 KB | doesn't contain S as a subsequence |
9 | Incorrect | 119 ms | 58292 KB | doesn't contain S as a subsequence |
10 | Incorrect | 100 ms | 58524 KB | doesn't contain S as a subsequence |
11 | Incorrect | 102 ms | 58656 KB | doesn't contain S as a subsequence |
12 | Incorrect | 87 ms | 59216 KB | doesn't contain S as a subsequence |
13 | Incorrect | 90 ms | 59192 KB | doesn't contain S as a subsequence |
14 | Incorrect | 89 ms | 59256 KB | not a zalsequence |