luyencode / comments

Server lưu trữ bình luận trên Luyện Code
https://luyencode.net
6 stars 3 forks source link

https://oj.luyencode.net/problem/PTICH #687

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Chi tiết bài tập - Luyện Code Online

https://luyencode.net/problem/PTICH

gnaigsolo commented 2 years ago

sao đơn giản mà có 1.79% AC thế ? :((((

HaNguyen1099 commented 2 years ago

ai AC rồi mình tham khảo với, của mình bị TLE

vanhhn commented 2 years ago

7/20 khoai

VanHoang110802 commented 2 years ago

14/20 dảk

namkhanh307 commented 2 years ago

include

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"); } } }

}

namkhanh307 commented 2 years ago

Đâ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.

Xem code AC

// #include 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"); } } } }

danh2006 commented 1 year ago

https://www.ideone.com/xfeeYF

lochuung commented 1 year ago

này sử dụng thuật toán RHO nha mọi người

dalptr commented 1 year ago

41 ms :))))) sử dụng thuật toán Pollard Rho nha mng