# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168328 | 2019-12-12T12:19:58 Z | ArKCa | Karte (COCI18_karte) | C++17 | 146 ms | 4868 KB |
#include <bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define pob pop_back #define f1 first #define s2 second #define N 500005 #define ekle 200 using namespace std; int n,cnt,a,k; vector<int>doru; int dizi[N]; int main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); scanf("%d %d",&n,&k); for(int i=0;i<n;i++){ scanf("%d",&dizi[i]); } sort(dizi,dizi+n); reverse(dizi+(n-k),dizi+n); reverse(dizi,dizi+n); for(int i=0;i<k;i++){ if( dizi [ i ] < ( i + 1 ) ){ printf("-1\n"); return 0; } } for(int i=0;i<n;i++){ printf("%d ",dizi[i] ); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 32 ms | 1272 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 61 ms | 2168 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 146 ms | 4868 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |