QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#344330 | #8250. Magnesium Supplementation | Haidy_Yasser# | WA | 2ms | 3996kb | C++14 | 1.4kb | 2024-03-04 01:48:40 | 2024-03-04 01:48:40 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(x) int(x.size())
#define all(vec) vec.begin(), vec.end()
#define rall(vec) vec.rbegin(), vec.rend()
#define cin(v) for (auto& cn : v) cin >> cn;
#define cout(v) for (auto &cn : v) cout << cn << " ";
#define MOD int(1e9+7)
// #define endl "\n"
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
void Haidy()
{
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifndef ONLINE_JUDGE
//freopen("input.txt","r",stdin),freopen("output.txt","w",stdout);
#endif
}
void solve();
int main()
{
Haidy();
int t = 1;
// cin >> t;
for(int i = 1;i<=t; i++)
{
solve();
}
return 0;
}
// int dx[] = {0, 0, 1, -1, 1, -1, 1, -1};
// int dy[] = {1, -1, 0, 0, 1, -1, -1, 1};
void solve()
{
ll desired, maxFactor, maxCount;
cin >> desired >> maxFactor >> maxCount;
// ll ans = 0;
set<ll > factors;
for(ll i = 1; i * i <= desired; i++){
if(desired % i == 0){
if(i <= maxFactor && i * maxCount >= desired){
factors.insert(i);
}
ll other = desired / i;
if(other <= maxFactor && other * maxCount >= desired && other != i){
factors.insert(other);
}
}
}
cout << factors.size() << endl;
for(auto &x : factors){
cout << x << endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3600kb
input:
6 6 4
output:
3 2 3 6
result:
ok 4 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
6 2 3
output:
1 2
result:
ok 2 lines
Test #3:
score: 0
Accepted
time: 2ms
memory: 3656kb
input:
735134400 425176838 584949686
output:
1342 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 24 25 26 27 28 30 32 33 34 35 36 39 40 42 44 45 48 50 51 52 54 55 56 60 63 64 65 66 68 70 72 75 77 78 80 84 85 88 90 91 96 99 100 102 104 105 108 110 112 117 119 120 126 130 132 135 136 140 143 144 150 153 154 156 160 165 168 170 175 176 180 1...
result:
ok 1343 lines
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3996kb
input:
97772875200 83501089612 34623233641
output:
3927 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 25 26 27 28 30 32 33 34 35 36 38 39 40 42 44 45 48 49 50 51 52 54 55 56 57 60 63 64 65 66 68 70 72 75 76 77 78 80 84 85 88 90 91 95 96 98 99 100 102 104 105 108 110 112 114 117 119 120 126 130 132 133 135 136 140 143 144 147 150 152 153 15...
result:
wrong answer 1st lines differ - expected: '4029', found: '3927'