Codeforces Round 860

Portal.

A. Showstopper

Portal.

赛时代码:

cpp 复制代码
#include <bits/stdc++.h>
using namespace std;
 
const int maxn=105;
int a[maxn],b[maxn];
 
int main()
{
	int t;cin>>t;
	while(t--)
	{
		memset(a,0,sizeof a);
		memset(b,0,sizeof b);
		int n;cin>>n;
		for(int i=1;i<=n;i++)
		// {
			cin>>a[i];
			// if(max2<=a[i])
				// max2=a[i],maxp2=i;
		// }
		for(int i=1;i<=n;i++)
		// {
			cin>>b[i];
			// if(max2<=a[i])
				// max2=a[i],maxp2=i;
		// }
		for(int i=1;i<=n;i++)
			if(a[i]>=b[i])
			{
				int tmp=a[i];
				a[i]=b[i],b[i]=tmp;
			}
		int maxa=0,maxb=0;
		for(int i=1;i<=n;i++) maxa=max(maxa,a[i]),maxb=max(maxb,b[i]);
		if(maxa<=min(a[n],b[n])&&maxb<=max(a[n],b[n])) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
			
	}
	return 0;
}

B. Three Sevens

Portal.

sol.

C. Candy Store

Portal.

sol.

D. Shocking Arrangement

Portal.

sol.

相关推荐
数据皮皮侠AI5 分钟前
顶刊同款!中国地级市风灾风险与损失数据集(2000-2022)|灾害 / 环境 / 经济研究必备
大数据·人工智能·笔记·能源·1024程序员节
Fab1an1 天前
Busqueda——Hack The Box 靶机
linux·服务器·学习·1024程序员节
技术专家2 天前
Stable Diffusion系列的详细讨论 / Detailed Discussion of the Stable Diffusion Series
人工智能·python·算法·推荐算法·1024程序员节
wenhaoran113 天前
CF1800F Dasha and Nightmares
c++·算法·字符串·codeforces·位运算
学传打活4 天前
古代汉语是源,现代汉语是流,源与流一脉相承。
微信公众平台·1024程序员节·汉字·中华文化
学传打活9 天前
【边打字.边学昆仑正义文化】_19_星际生命的生存状况(1)
微信公众平台·1024程序员节·汉字·昆仑正义文化
unable code16 天前
[HNCTF 2022 WEEK2]ez_ssrf
网络安全·web·ctf·1024程序员节
unable code17 天前
[NISACTF 2022]easyssrf
网络安全·web·ctf·1024程序员节
unable code18 天前
BUUCTF-[第二章 web进阶]SSRF Training
网络安全·web·ctf·1024程序员节
开开心心就好19 天前
进程启动瞬间暂停工具,适合调试多开
linux·运维·安全·pdf·智能音箱·智能手表·1024程序员节