답안 #1018557

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1018557 2024-07-10T06:48:58 Z vjudge1 Autići (COCI22_autici) C++17
50 / 50
11 ms 1372 KB
#include <bits/stdc++.h>
#define fast cin.tie(0)->sync_with_stdio(0);
#define int long long
#define inf ((int)1e18)
using namespace std;

int32_t main(){
	fast
	int n;
	cin >> n;
	int in, sum = 0, mn = inf;
	for(int i = 0; i < n; i++) {
		int in;
		cin >> in;
		mn = min(mn, in);
		sum += in;
	}
	cout << sum + (n - 2) * mn;
}

Compilation message

Main.cpp: In function 'int32_t main()':
Main.cpp:11:6: warning: unused variable 'in' [-Wunused-variable]
   11 |  int in, sum = 0, mn = inf;
      |      ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 8 ms 1332 KB Output is correct
4 Correct 11 ms 1116 KB Output is correct
5 Correct 9 ms 1208 KB Output is correct
6 Correct 6 ms 1112 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 388 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 8 ms 1332 KB Output is correct
4 Correct 11 ms 1116 KB Output is correct
5 Correct 9 ms 1208 KB Output is correct
6 Correct 6 ms 1112 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 388 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 3 ms 604 KB Output is correct
22 Correct 7 ms 1336 KB Output is correct
23 Correct 7 ms 1372 KB Output is correct
24 Correct 6 ms 1112 KB Output is correct
25 Correct 7 ms 1332 KB Output is correct
26 Correct 8 ms 1112 KB Output is correct
27 Correct 7 ms 1372 KB Output is correct
28 Correct 7 ms 1332 KB Output is correct
29 Correct 6 ms 1200 KB Output is correct
30 Correct 7 ms 1208 KB Output is correct