站外题求解

题目总版

DESTRUCTION_WA @ 2024-11-05 12:16:52

rt


by DESTRUCTION_WA @ 2024-11-05 12:34:16

千万不要尝试写那题,我还没找到测试点


by Civilight_Eterna @ 2024-11-06 19:50:18

@DESTRUCTION_WA

#include<bits/stdc++.h>
#define ll long long
using namespace std;
int T,n,m,used;
ll ans=0;
int main(){ios::sync_with_stdio(0);cin.tie(0),cout.tie(0);
    cin>>n>>m;
    ans+=m*2;
    n-=m;used=m;
    for(int i=n;i>=1;i--){
        used++;
        ans+=used;
    }cout<<ans<<'\n';
    return 0;
}

by DESTRUCTION_WA @ 2024-11-06 20:35:22

@Civilight_Eterna 蟹,已关


|