Open utterances-bot opened 2 years ago
sao đơn giản mà có 1.79% AC thế ? :((((
ai AC rồi mình tham khảo với, của mình bị TLE
7/20 khoai
14/20 dảk
int main(){ int i, n; scanf("%d", &n); int dem; for(i = 2; i <= n; i++){ dem = 0; while(n % i == 0){ ++dem; n /= i; } if(dem){ if(dem > 1) printf("%d %d", i, dem); else printf("%d %d", i, dem); if(n > i){ printf("\n"); } } }
}
Đây là lời giải của mình đã AC. Nếu bạn đã cố gắng mà chưa làm được thì có thể tham khảo lời giải của mình.
// #include
này sử dụng thuật toán RHO nha mọi người
41 ms :))))) sử dụng thuật toán Pollard Rho nha mng
Chi tiết bài tập - Luyện Code Online
https://luyencode.net/problem/PTICH