QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#343382#8250. Magnesium SupplementationMayaZayn#WA 0ms3632kbC++141.2kb2024-03-02 14:54:062024-03-02 14:54:07

Judging History

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

  • [2024-03-02 14:54:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-03-02 14:54:06]
  • 提交

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 && 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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6 6 4

output:

3
2 3 6 

result:

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