QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#343426#8250. Magnesium SupplementationMayaZayn#WA 0ms3672kbC++141.2kb2024-03-02 15:54:402024-03-02 15:54:40

Judging History

你现在查看的是最新测评结果

  • [2024-03-02 15:54:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2024-03-02 15:54:40]
  • 提交

answer

#include <bits/stdc++.h>
#define MayaZayn ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define ll long long
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define all_r(x) (x).rbegin(), (x).rend()
#define mnEl(vec) *min_element(vec.begin(), vec.end())
#define mxEl(vec) *max_element(vec.begin(), vec.end())
#define yes cout << "YES"
#define no cout << "NO"
#define in(v) for (auto & x : v) cin >> x
#define out(v) for (auto & x : v) cout << x << ' '
#define inLL(v) for (ll & x : v) cin >> x
#define openIn(x) freopen(x, "r", stdin);
#define openOut(x) freopen(x, "w", stdout);
#define M 1000000007
#define N 100005

using namespace std;

void solve() {
    ll n, k, p;
    cin >> n >> k >> p;

    vector<ll> ans;
    for (ll i = 1; i <= sqrtl(n); i++) {
        if (n % i == 0) {
            if (i <= k && n / i <= p)
                ans.push_back(i);
            if (n / i != i && n / i <= k && n / (n / i) <= p)
                ans.push_back(n / i);
        }
    }
    sort(all(ans));

    cout << ans.size() << endl;
    out(ans);
}

int main() {
    MayaZayn

//    int t;
//    cin >> t;
//    while (t--)
    solve();

    return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3672kb

input:

6 6 4

output:

3
2 3 6 

result:

wrong answer 2nd lines differ - expected: '2', found: '2 3 6 '