前言:
昨天晚上的比赛,可惜E题太笨了没想到如何解决,不过好在看到F过的多直接跳过去写F了,能过个5个也还不错了,而且一个罚时也没吃。之后的题我还是会再能补的时候补完的噢!
正文:
链接:Dashboard - Codeforces Round 970 (Div. 3) - Codeforces
题目:
A. Sakurako's Exam:
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int a,b;
cin>>a>>b;
if(b==0&&a%2==0&&a!=0){
cout<<"YES"<<endl;
}
else if(a==0&&b%2==0){
cout<<"YES"<<endl;
}
else if(a%2==0&&a!=0){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
return 0;
}
简单的数字逻辑题,情况并不多,慢慢讨论就行了。
B. Square or Not:
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
string a;
int main(){
int t;
cin>>t;
while(t--){
int n,cnt=0;
cin>>n;
cin>>a;
for(int i=0;i<n;i++){
if(cnt==0&&a[i]=='0'){
cnt=i+1;
}
}
if(cnt==0)cnt=n;
else cnt-=2;
int cnt2=n/cnt;
if(cnt2!=