Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93481 | 陈铎文 | 02武王伐纣 | C++ | Wrong Answer | 0 MS | 256 KB | 455 | 2024-10-16 18:57:05 |
#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; }
------Input------
0
------Answer-----
34600
------Your output-----