3 条题解

  • 2
    @ 2026-3-28 15:54:45

    #include <bits/stdc++.h> using namespace std;

    int main() { long long x, y, sum = 0; cin >> x >> y; if (x > y) swap(x, y); for (int i = x; i <= y; i++) { bool q = 1; for (int j = 2; j <= sqrt(i); j++) if (i % j == 0) { q = 0; break; } if (q && i != 1) sum++; } cout << sum << endl; return 0; }

    信息

    ID
    12098
    时间
    1000ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    34
    已通过
    11
    上传者