제출 #1299714

#제출 시각아이디문제언어결과실행 시간메모리
1299714mefe123Prosjek (COCI18_prosjek)C++20
0 / 50
1 ms584 KiB
		#include <bits/stdc++.h> 

		#define int long long
		#define pb push_back
		
		#define be begin()
		#define en end()
		#define fi first
		#define se second
		#define makep make_pair
		#define nn int n; cin>>n
		#define mm int m; cin>>m
		#define kk int k; cin>>k

		using namespace std;

		int mod=1e9+7;

		void ai(vector<int> &v){
			for(auto &go : v){
				cin>>go;
			}
		}
		
		void yesno(int k){
			if(k==1){
					cout<<"Yes";
				}
				else{
				cout<<"No";
			}
		}

	
		void solve(){
			int n;
			scanf("%lld",&n);
			priority_queue<float,vector<float>,greater<float>> pq;
			for(int i=0;i<n;i++){
				float x;
				cin>>x;
				pq.push(x);
			}
			while(pq.size()>1){
				float x=pq.top();
				pq.pop();
				float y=pq.top();
				pq.pop();
				float z=float((x+y)/float(2));
				pq.push(z);
			} 
			float cevap=pq.top();
			printf("%6f\n",cevap);                                      
		}

		signed main(){
			ios::sync_with_stdio(false);
			cin.tie(nullptr);	
			int t=1;
			//cin>>t;
			while(t--){	
				solve();
			}
		}

		

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

prosjek.cpp: In function 'void solve()':
prosjek.cpp:37:30: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |                         scanf("%lld",&n);
      |                         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...