답안 #927930

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
927930 2024-02-15T14:10:19 Z Isam Akcija (COCI15_akcija) C++17
80 / 80
12 ms 1620 KB
#include<bits/stdc++.h>

/*

......

*/

using namespace std;

constexpr int sz = 2e5 + 5;

int n;
long long ans(0);

int main(){
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n;
	vector<int> A(n);
	for(auto &j : A) cin >> j, ans += j;
	sort(A.begin(), A.end());
	for(register int i = n - 3; i >= 0; i -= 3){
		ans -= A[i];
	}
	cout << ans << '\n';
	return 0;
}
/*


*/

Compilation message

akcija.cpp: In function 'int main()':
akcija.cpp:22:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |  for(register int i = n - 3; i >= 0; i -= 3){
      |                   ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 468 KB Output is correct
6 Correct 9 ms 1116 KB Output is correct
7 Correct 7 ms 1116 KB Output is correct
8 Correct 6 ms 1116 KB Output is correct
9 Correct 12 ms 1620 KB Output is correct
10 Correct 12 ms 1224 KB Output is correct