제출 #696895

#제출 시각아이디문제언어결과실행 시간메모리
696895Do_you_copyAutići (COCI22_autici)C++17
0 / 50
37 ms1656 KiB
#include <bits/stdc++.h>
#define fi first
#define se second
#define faster ios_base::sync_with_stdio(0); cin.tie(0);
#define pb push_back

using namespace std;
using ll = long long;
using pii = pair <int, int>;

const int maxN = 1e5 + 1;
const int inf = 0x3f3f3f3f;
int n;
int a[maxN];
void Init(){
    cin >> n;
    int minn = inf;
    ll sum = 0;
    for (int i = 1; i <= n; ++i){
        cin >> a[i];
        minn = min(minn, a[i]);
        sum += a[i];
    }
    cout << sum + minn * (n - 2);
}

#define taskname "test"

signed main(){
    if (fopen(taskname ".inp", "r")){
        freopen(taskname ".inp", "r", stdin);
        freopen(taskname ".out", "w", stdout);
    }
    int tt = 1;
    //cin >> tt;
    while (tt--){
        Init();
    }
}

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

Main.cpp: In function 'int main()':
Main.cpp:31:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |         freopen(taskname ".inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:32:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         freopen(taskname ".out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...