Bingbong的化学世界
没读好题,没必要写这么复杂的
#include <bits/stdc++.h>
using namespace std;
string s4,s5,s6,a1,a2,a3,a4,a5,a6,b1,b2,b3,b4,b5,b6;
string n1,n2,n3,n4,n5,n6;
int main()
{
string s1="...|...";
string s2="..._...";
string s3="../.\..";
s4="..|.|..";s5="..\_/\.";s6=".......";
a1=".......",a2="..._...",a3="../.\/.";
a4="..|.|..";a5="..\_/\.";a6=".......";
b1="...|...";b2="..._...";b3="../.\..";
b4="..|.|..";b5="..\_/..";b6="...|...";
cin>>n1>>n2>>n3>>n4>>n5>>n6;
if(n1==s1){
if(n6==s6) cout<<"m";
else cout<<"p";
}
else cout<<"o";
return 0;
}
Bingbong的数数世界
#include <bits/stdc++.h>
using namespace std;
int t;
int n;
int main()
{
cin>>t;
while(t--){
cin>>n;
if(n%2==1) cout<<"Bing"<<endl;
else{
if(n/2%2==0) cout<<"Bong"<<endl;
else cout<<"Bing"<<endl;
}
}
return 0;
}
Bingbong的蛋仔世界
画了几个图,猜出了结论,有史以来最早出c题的比赛
#include <bits/stdc++.h>
using namespace std;
int n,m,k;
int a,b;
int res;
int main()
{
cin>>n>>m>>k;
for(int i=0;i<k;i++){
cin>>a>>b;
if(abs(n/2+1-a)+abs(m/2+1-b)<=max(n/2,m/2)) res++;
}
cout<<res;
return 0;
}
Bingbong的奇偶世界
dp问题,赛中想不出来状态的定义,靠赛后讲解才懂的
#include <bits/stdc++.h>
using namespace std;
const int mod=1000000007;
const int ll=1;
char s[200010];int n;
int ans;
int dp[200010][3];
//1:[1^9]xxx
//2:[1^9]xxx[02468]
void add(int &a,int b){
a+=b;
if(a>=mod) a-=mod;
}
int main()
{
cin>>n>>&s[1];
for(int i=1;i<=n;i++){
if((s[i]-'0')%2==0) ans++;
}
for(int i=1;i<=n;i++){
dp[i][1]=dp[i-1][1],dp[i][2]=dp[i-1][2];
add(dp[i][1],dp[i-1][1]);
if((s[i]-'0')%2==0) add(dp[i][2],dp[i-1][1]);
if(s[i]!='0') dp[i][1]++;
}
cout<<ans+dp[n][2];
return 0;
}