goorm
(구름 먼데이챌린지 c++ 1주차)1. 경로의 개수
naeunchan
2022. 10. 31. 18:28
728x90
반응형
goorm
구름은 클라우드 기술을 이용하여 누구나 코딩을 배우고, 실력을 평가하고, 소프트웨어를 개발할 수 있는 클라우드 소프트웨어 생태계입니다.
goorm.co
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<vector<bool>> island;
unsigned long long answer = 1;
int n;
int main() {
cin >> n;
for(int i = 0; i < n; i++){
int p;
scanf("%d", &p);
answer *= p;
}
printf("%lld", answer);
return 0;
}
1단계인 만큼 쉬운 문제.
경로의 개수를 구하면 되기 때문에 주어진 모든 수를 곱하면 된다.
int가 표현할 수 있는 수를 넘어갈 수 있으니 unsinged long long으로 곱하면 된다.
728x90
반응형