社区讨论
为什么在考试一样的代码只得了12.5,在洛谷全对?
B4448[GESP202512 二级] 黄金格参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @mjxotllr
- 此快照首次捕获于
- 2026/01/03 10:32 2 个月前
- 此快照最后确认于
- 2026/01/06 15:35 上个月
CPP
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int h,w,x,cnt=0;
cin>>h>>w>>x;
for(int r=1;r<=h;++r){
for(int c=1;c<=w;++c){
if(sqrt(r*r+c*c)<=x+r-c){
cnt++;
}
}
}
cout<<cnt<<endl;
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...