-
C++ 모두의 약수 ( 제한시간 1초 )소프트웨어전공/알고리즘 문제풀이 2021. 9. 21. 20:46
문제는
위의 풀이로는 시간제한을 통과하지 못하므로..
문제는 오래 고민해도 이걸 떠올리기 쉽지 않다는 거..
발상하는 과정을 따라 익히는 수 밖에 없다
-> 일일이 약수를 찾는게 아니라 배수의 관점에서 생각해 볼것..
"어떻게 하면 불필요한 연산을 제외하고 원하는 결과값을 얻을 수 있는가?"
특별한 발상이 아니라, 결국 위 질문으로부터 시작해서 이것저것 시도해 보는 태도가 필요하다.
'소프트웨어전공 > 알고리즘 문제풀이' 카테고리의 다른 글
백준 1924번 _ 2007년 x월 y일은 무슨 요일? [C++] (0) 2021.09.23 백준 2741번 _ C++ ( 시간초과 해결하기 ) (0) 2021.09.22 C++ 모두의 약수 (0) 2021.09.21 백준 11721번 _ C++ 열 개씩 끊어 출력하기 (0) 2021.09.21 백준 11720번 _ C++ 입출력 (0) 2021.09.21