QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#240294 | #3241. 最小公倍树 | Cofe_Milk# | WA | 6ms | 11424kb | C++17 | 823b | 2023-11-05 14:18:43 | 2023-11-05 14:18:44 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
//#define int ll
#define endl '\n'
#define fi first
#define se second
#define pii pair<int, int>
#define rep(i,a,n,k) for(int i=a;i<=n;i+=k)
#define per(i,a,n,k) for(int i=a;i>=n;i-=k)
/*·········································*/
const int N = 1e6 + 10;
int l, r;
ll res[N], ans;
void solve()
{
memset(res, 0x3f, sizeof res);
cin >> l >> r;
rep(i,1,r,1)
{
ll x = 0;
rep(j,i,r,i) if(j >= l && j <= r)
{
if(!x) x = j;
else res[j] = min(res[j], x * j / i);
}
}
rep(i,l+1,r,1) ans += res[i];
cout << ans;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
int t = 1;
//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: 6ms
memory: 11424kb
input:
100000 200000
output:
171354945472486
result:
wrong answer 1st lines differ - expected: '171167496763057', found: '171354945472486'