From 9e28e4c7b67c54229df11d355047ac8a88ea1817 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sun, 15 Dec 2019 15:09:13 +0700 Subject: Normalize pathname --- NTU/dayso6.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 NTU/dayso6.c (limited to 'NTU/dayso6.c') diff --git a/NTU/dayso6.c b/NTU/dayso6.c deleted file mode 100644 index d1685d2..0000000 --- a/NTU/dayso6.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -int main() -{ - short n, i; - long long *a ; - long long *b, tmp; - - scanf("%hd", &n); - a = malloc(n * 8); - b = malloc(n * 8); - - scanf("%ld", a); - *b = *a; - for (i = 1; i < n - 2; i++) { - scanf("%ld", &a[i]); - b[i] = (a[i] > a[i - 1]) ? a[i] : a[i - 1]; - } - scanf("%ld %ld", &a[n - 2], &a[n - 1]); - - *b = *b + a[1] * 2; - for (i = 1; i < n - 2; i++) { - b[i] = b[i] + a[i + 1] * 2; - if (b[i - 1] > b[i]) - b[i] = b[i - 1]; - } - - *b = *b + a[2] * 3; - for (i = 1; i < n - 2; i++) { - b[i] = b[i] + a[i + 2] * 3; - if (b[i - 1] > b[i]) - b[i] = b[i - 1]; - } - - printf("%lld\n", b[n - 3]); - - return 0; -} -- cgit 1.4.1