# 1011 Kindergarten Physics

#include<iostream>
using namespace std;
int main()
{
int T;
cin>>T;
while(T--){
double a,b,d,t;
cin>>a>>b>>d>>t;
printf("%.10lf\n",d-1e-10);
}
return 0;
}


# 1002 Blow up the Enemy

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int mod = 1e9+7;
const int N = 1e5+7;

int a[N],b[N];

double fun(int i,int j){
int x = ceil(100.0/a[i])*b[i]-b[i];
int y = ceil(100.0/a[j])*b[j]-b[j];
if(x==y) return 0.5;
else if(x<y) return 1.0;
else return 0.0;
}

int main()
{
int T; scanf("%d",&T);
while(T--){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d%d",&a[i],&b[i]);
double ans = 0;
for(int i=1;i<=n;i++){
double num=0;
for(int j=1;j<=n;j++){		//也可以先O(n)找到最优的武器，再计算胜率
num += fun(i,j);
}
ans = max(num/n,ans);
}
printf("%.8lf\n",ans);
}
return 0;
}


# 1005 Equal Sentences

#include<bits/stdc++.h>
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;
typedef long long LL;
const int mod = 1e9+7;
const int N = 1e5+7;

int dp[N];

int main()
{
IO;
int T; cin>>T;
string s[N];
while(T--){
int n;
cin>>n;
for(int i=1;i<=n;i++) cin>>s[i],dp[i]=0;
dp[0]=dp[1] = 1;
for(int i=2;i<=n;i++){
if(s[i]==s[i-1]) dp[i] = dp[i-1];
else dp[i] = (dp[i-1]+dp[i-2])%mod;
}
cout<<dp[n]<<"\n";
}
return 0;
}


# 1004 Deliver the Cake

在这里插入代码片


07-17 1462
08-20
03-30
09-18