50154. Path within a Network
難度:1.5/51
2
3
4
5
6
7
8
9
10
11
12
13
14
15#include <stdio.h>
int main(){
int a, b, c, d, e, f, g;
scanf("%d %d %d %d %d %d %d", &a, &b, &c, &d, &e, &f, &g);
int cnt_edge = a + b + c + d + (a * e) + (b * e) + (c * e)
+ (c * f) + (d * f) + (e * g) + g + f;
int cnt_path = (a * e * g) + (b * e * g) + (c * e * g) + (c * f)
+ (d * f);
printf("%d\n%d\n", cnt_edge, cnt_path);
}
50154. Path within a Network
https://aaronlin1229.github.io/judgegirl_50154/