void solve()
{
mt19937 rng;
int sum=0;
for (int i = 0; i<100000; ++i) {
int x, y, r;
x = rng() % 199 - 99;
y = rng() % 199 - 99;
do
{
r= rng() % 199 - 99;
}while(x+r>100||x-r<-100||y+r>100||y-r<-100);
sum+=abs(x)+abs(y);
}
cout<<sum;
}
第二个是
void solve()
{
mt19937 rng;
int sum=0;
for (int i = 0; i<100000; ++i) {
int x, y, r;
do{
x = rng() % 199 - 99;
y = rng() % 199 - 99;
r= rng() % 199 - 99;
}while(x+r>100||x-r<-100||y+r>100||y-r<-100);
sum+=abs(x)+abs(y);
}
cout<<sum;
}
通过观察sum可得第个方法普遍大于90*n;
这是jiangly的方法和代码
include:<bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int n;
std::cin>>n;
int sum = 0;
for (int i = 0; i < n; i++) {
int x, y, r;
std::cin>>x>>y>>r;
sum += std::abs(x) + std::abs(y);
}
if (sum>90 * n) {
std::cout<<"bit-noob\n";
} else {
std::cout<<"buaa-noob\n";
}
return 0;
}
数学联邦政治世界观提示您:看后求收藏(同人小说网http://tongren.me),接着再看更方便。