Submission #758108

# Submission time Handle Problem Language Result Execution time Memory
758108 2023-06-14T07:33:01 Z KN200711 Prosjek (COCI14_prosjek) C++14
50 / 50
1 ms 296 KB
# include <bits/stdc++.h>
# define ll long long
using namespace std;

int main() {
	int N;
	scanf("%d", &N);
	
	ll sum = 0ll;
	for(int i=1;i<=N;i++) {
		ll a;
		scanf("%d", &a);
		printf("%d ", (1ll * a * 1ll * i) - sum);
		sum = (1ll * a * 1ll * i);
	}
	printf("\n");
}

Compilation message

prosjek.cpp: In function 'int main()':
prosjek.cpp:12:11: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   12 |   scanf("%d", &a);
      |          ~^   ~~
      |           |   |
      |           |   long long int*
      |           int*
      |          %lld
prosjek.cpp:13:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   13 |   printf("%d ", (1ll * a * 1ll * i) - sum);
      |           ~^    ~~~~~~~~~~~~~~~~~~~~~~~~~
      |            |                        |
      |            int                      long long int
      |           %lld
prosjek.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%d", &N);
      |  ~~~~~^~~~~~~~~~
prosjek.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d", &a);
      |   ~~~~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 0 ms 296 KB Output is correct
9 Correct 1 ms 280 KB Output is correct
10 Correct 1 ms 212 KB Output is correct