Submit solution
Points:
0.03 (partial)
Time limit:
1.0s
Memory limit:
256M
Input:
stdin
Output:
stdout
Problem source:
Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch
Hãy tìm tất cả các số nguyên tố trong đoạn ~[A~, ~B]~.
Input
Gồm ~2~ số nguyên ~A~ và ~B~ cách nhau bởi ~1~ dấu cách ~(1 \leq A \leq B \leq 200000)~.
Output
Ghi ra tất cả các số nguyên tố trong đoạn ~[A~, ~B]~ theo thứ tự tăng dần. Mỗi số trên ~1~ dòng.
Sample Input
1 10
Sample Output
2
3
5
7
Comments
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.
Links https://youtu.be/U8eNPUUpN6A?si=V6Fg7O1nDCVdU1de* video về sàng cho ae nào chưa bt*
include <bits/stdc++.h>
using namespace std;
bool snt(int n){
} int prime[100000];
void sang(){
} int main(){
}
https://youtu.be/U8eNPUUpN6A?si=V6Fg7O1nDCVdU1de
sao lại ko AC full v nhnhỉ
bài này dùng miller rabin nha
dùng sàng thôi cx đủ rồi
This comment is hidden due to too much negative feedback. Show it anyway.
Dùng sàng nguyên tố.
Bài này cứ dùng sàng là ok
This comment is hidden due to too much negative feedback. Show it anyway.
This comment is hidden due to too much negative feedback. Show it anyway.