페이지

6359번: 만취한 상범

https://www.acmicpc.net/problem/6359


$O(t)$

마지막엔 약수 개수가 홀수인 방만 열려있을 것이다. 그러한 수는 제곱수이므로 sqrt(n)을 출력하자.


#include<cstdio>
#include<math.h>
int t, n;
int main() {
    scanf("%d", &t);
    while (t--) scanf("%d", &n), printf("%d\n", (int)sqrt(n));
    return 0;
}

댓글 없음 :

댓글 쓰기