Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93187 王郡翊 02武王伐纣 C++ Wrong Answer 0 MS 264 KB 455 2024-10-12 17:21:56

Tests(0/1):


Code:

#include<bits/stdc++.h> #define ll long long using namespace std; void Out128(__int128 x){ if(x==0){ return; } int y=x%10; Out128(x/10); cout<<y; } ll l,r; int main(){ cin>>l>>r; ll lg=sqrt(l); ll rg=sqrt(r); __int128 ans=0; for(ll i=lg;i<=rg;i++){ ll nex=(i+1)*(i+1); ll cur=i*i; if(cur<l){ cur=l; } if(nex>r){ nex=r; } ans=ans+(nex-cur)*i; } ans+=rg; Out128(ans); return 0; }


Run Info:

------Input------
0
------Answer-----
34600
------Your output-----