Submission #201080

# Submission time Handle Problem Language Result Execution time Memory
201080 2020-02-09T09:54:13 Z SamAnd Tarifa (COCI16_tarifa) C++17
50 / 50
6 ms 380 KB
#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;
}

Compilation message

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 time Memory Grader output
1 Correct 5 ms 380 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 376 KB Output is correct
7 Correct 5 ms 376 KB Output is correct
8 Correct 6 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 256 KB Output is correct