codeforse EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2)(个人题解)(未补全)

前言:

  前几天晚上打的比赛,只能说div1确实有难度,第三题爆改两个多小时都没过,果然菜是原罪啊!之后会看看别人的题解看看能补多少道吧。

正文:

链接:Dashboard - EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) - Codeforces

  A. Distanced Coloring:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--){
		ll n,m,k;
		scanf("%lld%lld%lld",&n,&m,&k);
		ll l=min(n,k),r=min(m,k);
		ll ans=l*r;
		printf("%lld\n",ans);
	}
	return 0;
}

签到题,看样例就能看出做法。

B. Removals Game:

#include<bits/stdc++.h>
using namespace std;
const int N=3e5+5;
int a[N],b[N];
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		for(int i=1;i<=n;i++){
			scanf("%d",&a[i]);
		}
		int flag=1,flag2=1;
		for(int i=1;i<=n;i++){
			scanf("%d",&b[i]);
			if(a[i]!=b[i]){
				flag=0;
			}
		}
		for(int i=1;i<=n;i++){
			if(a[i]!=b[n-i+1]){
				flag2=0;break;
			}
		}
		if(flag==0&&flag2==0){
			cout<<"Alice"<<endl;		
		}
		else{
			cout<<"Bob"<<endl;
		}
	}
	return 0;
}

bob要赢当且仅当他的数组与alice完全重合或相反才能赢。

后记:

近期cf比赛有好多场啊,上分的速度也降低下来了,可能绿名就是我目前的瓶颈了吧,还得加油学习啊。

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值