제출 #167372

#제출 시각아이디문제언어결과실행 시간메모리
16737244442Akcija (COCI15_akcija)C++11
80 / 80
75 ms5624 KiB
#include <bits/stdc++.h>
using namespace std;
int n;
long long a,s;
multiset<int>m;
int main (){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
scanf("%d",&n);
for(int i=0;i<n;i++){
	 scanf("\n%lld",&a);
	 m.insert(a);
	 s=s+a;
}
 m.insert(0);
 m.insert(0);
 m.insert(0);
 multiset<int>::iterator it;
 it=m.end();
 it--;
 it--;
 it--;
 while(*it>0){
 	 s=s-*it;
 	 it--;
 	 it--;
 	 it--;
 }
 printf("%lld",s);
return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

akcija.cpp: In function 'int main()':
akcija.cpp:9:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
 scanf("%d",&n);
 ~~~~~^~~~~~~~~
akcija.cpp:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("\n%lld",&a);
   ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...