QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#343426 | #8250. Magnesium Supplementation | MayaZayn# | WA | 0ms | 3672kb | C++14 | 1.2kb | 2024-03-02 15:54:40 | 2024-03-02 15:54:40 |
Judging History
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 '