Submission #470165

# Submission time Handle Problem Language Result Execution time Memory
470165 2021-09-03T07:18:55 Z Karabasan Tarifa (COCI16_tarifa) C++17
50 / 50
1 ms 332 KB
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forcin for(int i=0;i<n;i++) scanf("%d",&dizi[i]);
#define forcout for(int i=0;i<n;i++) printf("%d ",dizi[i]);
#define ll long long

using namespace std;
int n,t;
int dizi[100005];
int toplam;
int x;
int main()
{
    fast;
    scanf("%d",&x);
    scanf("%d",&n);
    forcin;
    for(int i=0;i<n;i++)
        toplam+=x-dizi[i];
    printf("%d",toplam+x);
    return 0;
}

Compilation message

tarifa.cpp: In function 'int main()':
tarifa.cpp:15:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     scanf("%d",&x);
      |     ~~~~~^~~~~~~~~
tarifa.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
tarifa.cpp:3:42: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    3 | #define forcin for(int i=0;i<n;i++) scanf("%d",&dizi[i]);
      |                                     ~~~~~^~~~~~~~~~~~~~~
tarifa.cpp:17:5: note: in expansion of macro 'forcin'
   17 |     forcin;
      |     ^~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 320 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct