codechef121轮(A-G)题解
⭐️A.Leg Space
题目:
🌟题解:
很简单,比较就行
代码:
#include <bits/stdc++.h>
using namespace std;
int main() {// your code goes here
int n,m;cin>>n>>m;
if(n<m)cout<<"YES";
else cout<<"NO";
}
⭐️B.The Man Code
题目:
🌟题解:
找下规律就行
代码:
#include <bits/stdc++.h>
using namespace std;int main() {// your code goes here
int t;cin>>t;
while(t--){int n;cin>>n;cout<<(n+1)/2<<' '<<(n+2)/3<<endl;
}
}
⭐️C.Anti Adjacent Swaps
题目:
🌟题解:
也很简单的一道,找下规律
代码:
#include<iostream>
using namespace std;
int n;
string s1,s2,s3;
int ans;
int main()
{cin>>n;cin>>s1>>s2>>s3;for(int i=0;i<n;i++){if(s1[i]==s2[i] && s1[i]==s3[i]) continue;else if(s1[i]==s2[i] || s1[i]==s3[i] || s2[i]==s3[i]) ans++;else ans+=2;}cout<<ans<<endl; return 0;
}
⭐️D.Caesar Cipher Lite
题目:
🌟题解:
凯撒密码了解就能做出来
代码:
#include <bits/stdc++.h>
using namespace std;int main() {// your code goes here// a + 3*x = b///3*x = b - aint t,n;string p,q;cin>>t;while(t--){cin>>n>>p>>q;for(int i=0;i<n;i++){for(int j=0;j<=50;j++){if((p[i]-'A'+3*j)%26 == q[i]-'A'){cout<<j<<" ";break;}}}cout<<"\n";}
}
⭐️E.
题目:
🌟题解:
代码:
⭐️F.
题目:
🌟题解:
代码:
⭐️G.
题目:
🌟题解:
代码:
}