제출 #201080

#제출 시각아이디문제언어결과실행 시간메모리
201080SamAndTarifa (COCI16_tarifa)C++17
50 / 50
6 ms380 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 102;

int x, n;
int a[N];

int main()
{
    scanf("%d%d", &x, &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &a[i]);
    int ans = 0;
    for (int i = 1; i <= n; ++i)
    {
        ans += x;
        ans -= a[i];
    }
    ans += x;
    printf("%d\n", ans);
    return 0;
}

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

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