제출 #81634

#제출 시각아이디문제언어결과실행 시간메모리
81634xiaowuc1Akcija (COCI15_akcija)C++14
80 / 80
32 ms3512 KiB
#include <bits/stdc++.h> /* unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count(); mt19937 g1.seed(seed1); ios_base::sync_with_stdio(false); cin.tie(NULL); */ using namespace std; const double PI = 2 * acos(0); typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> pii; typedef pair<int, ll> pill; typedef pair<ll, ll> pll; typedef long double ld; typedef vector<vector<ll>> matrix; int main() { int n; scanf("%d", &n); vector<int> v; for(int i = 0; i < n; i++) { int t; scanf("%d", &t); v.push_back(t); } sort(v.begin(), v.end()); reverse(v.begin(), v.end()); ll ret = 0; for(int i = 0; i < n; i++) { if(i%3==2) continue; ret += v[i]; } printf("%lld\n", ret); }

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

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