Submission #168324

# Submission time Handle Problem Language Result Execution time Memory
168324 2019-12-12T12:13:41 Z ArKCa Karte (COCI18_karte) C++17
0 / 120
2 ms 380 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);
    if(dizi[0]<=1){
    	printf("-1\n");
    	return 0;
    }
    for(int i=0;i<n;i++){
    	printf("%d ",dizi[i] );
    }

}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:16:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  freopen("a.gir","r",stdin);  
  ~~~~~~~^~~~~~~~~~~~~~~~~~~
karte.cpp:17:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("a.cik","w",stdout);
     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
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 time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 256 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 380 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 380 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 376 KB Checker has crashed
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 OK 2 ms 256 KB Checker has crashed
2 Halted 0 ms 0 KB -