申请加强数据
查看原帖
申请加强数据
402102
tXX_F楼主2024/1/11 11:13

看不下去了,这代码也能过。

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int Maxn = 25000 + 5;
int n;
int cnt;
inline void solve() {
	cnt = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; i * i + j * j <= n * n; j++) {
			cnt++;
		}
	}
	cout << 4 * cnt + 4 * n + 1 << endl;
}
inline void work() {
	while (cin >> n && n) {
		solve();
	}
}
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	work();
	return 0;
}
2024/1/11 11:13
加载中...