# 牛客网NOIP赛前集训营-普及组（第四场）

https://www.nowcoder.com/acm/contest/167#question

A 逻辑

#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e6 + 5;
const int M = 5e5 + 5;

int main()
{
int n;
cin >> n;

int t = n - 5000;
int sum = 0;

if(t >= 3000){

sum += 90;
if(t >= 12000){

sum += 9000 * 0.1;

if(t >= 25000){
sum += 13000 * 0.2;

if(t >= 35000){
sum += 10000 * 0.25;

if(t >= 55000){

sum += 20000 * 0.3;

if(t >= 80000){

sum += 25000 * 0.35;
sum += (t - 80000) * 0.45;

}else
sum += (t - 55000) * 0.35;

}else
sum += (t - 35000) * 0.3;

}else
sum += (t - 25000) * 0.25;

}else
sum += (t - 12000) * 0.2;
}
else
sum += (t - 3000) * 0.1;

}else if(t >= 0){
sum += t * 0.03;
}

cout << n - sum << endl;

return 0;
}


B题

#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e6 + 5;
const int M = 5e5 + 5;

int main()
{
int n;
cin >> n;

double r = 1;

r = pow(0.5,n);

printf("%.*f\n",n,r);
return 0;
}


C题太长了。。没看

D题规律题

include<bits/stdc++.h>
using namespace std;
long long n,mod=10007,p[10009]={1,1,2};
int main()
{
string a;
cin>>a;
for(int i=0;i<a.length();i++)
n=(n*10+a[i]-'0')%10006;
for(int i=3;i<=n;i++)
p[i]=(2*p[i-1]+p[i-3])%mod;
cout<<p[n]<<endl;
}

• 广告
• 抄袭
• 版权
• 政治
• 色情
• 无意义
• 其他

120