Submission #168323

#TimeUsernameProblemLanguageResultExecution timeMemory
168323ArKCaKarte (COCI18_karte)C++17
12 / 120
146 ms4912 KiB
#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); if(dizi[(n-k)]<=1){ printf("-1\n"); return 0; } reverse(dizi+(n-k),dizi+n); reverse(dizi,dizi+n); for(int i=0;i<n;i++){ printf("%d ",dizi[i] ); } }

Compilation message (stderr)

karte.cpp: In function 'int main()':
karte.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d",&n,&k);
     ~~~~~^~~~~~~~~~~~~~~
karte.cpp:21:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
      scanf("%d",&dizi[i]);
      ~~~~~^~~~~~~~~~~~~~~
#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...