Codeforces Round 970 (Div. 3) (个人题解)(未补完)

前言:

  昨天晚上的比赛,可惜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!=
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值