Submission #470558

# Submission time Handle Problem Language Result Execution time Memory
470558 2021-09-04T09:12:34 Z watoKE Prosjek (COCI14_prosjek) C++17
50 / 50
1 ms 204 KB
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forcin for(int i=1;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,cevap;
int dizi[105];
int pre[105];
int main()
{
    fast;
    scanf("%d",&n);
    forcin;
    for(int i=1;i<=n;i++)
        dizi[i]*=i;
    for(int i=1;i<=n;i++)
    {
        cevap=dizi[i]-pre[i-1];
        pre[i]+=cevap+pre[i-1];
        printf("%d ",cevap);
    }





    return 0;
}

/*
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀⢠⠞⠉⠙⠲⡀⠀
⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀ ⠀⠀⢳⡀  ⡏⠀⠀⠀⠀⠀⢷
⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀⢸⠀⠀⠀⠀⠀ ⡇
⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀⣸⠀⠀Ez⠀ ⡇
⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀ ⠀⣿⠀⢹⠀⠀⠀⠀⠀ ⡇
⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀⡇⠀⠀⠀⠀⡼
⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀⠘⠤⣄⣠⠞⠀
⠀⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀
⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀
⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀⠀⣄⢸⠀⠀⠀⠀⠀⠀
⣿⣿⣧⣀⣿.........⣀⣰⣏⣘⣆⣀⠀⠀


░██████╗░█████╗░██╗████████╗░█████╗░███╗░░░███╗░█████╗░
██╔════╝██╔══██╗██║╚══██╔══╝██╔══██╗████╗░████║██╔══██╗
╚█████╗░███████║██║░░░██║░░░███████║██╔████╔██║███████║  SENSEI
░╚═══██╗██╔══██║██║░░░██║░░░██╔══██║██║╚██╔╝██║██╔══██║
██████╔╝██║░░██║██║░░░██║░░░██║░░██║██║░╚═╝░██║██║░░██║
╚═════╝░╚═╝░░╚═╝╚═╝░░░╚═╝░░░╚═╝░░╚═╝╚═╝░░░░░╚═╝╚═╝░░╚═╝



*/

Compilation message

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