为什么1e9能过
查看原帖
为什么1e9能过
1033990
lw393楼主2025/1/1 17:18

rt,下面是暴力

#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve(){
    int l, r, a;
    cin >> l >> r >> a;
    int ans = 0;
    int temp = a;
    while(temp < (r - l + 1)){
        ans += (r - l - temp + 1);
        temp += a;
    }
    cout << ans << '\n';
}

signed main(){
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    return 0;
}
2025/1/1 17:18
加载中...