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.

相关推荐
开开心心就好4 天前
开源免费高速看图工具,支持漫画大图秒开
linux·运维·服务器·安全·ruby·symfony·1024程序员节
unable code7 天前
磁盘取证-Flying_High
网络安全·ctf·misc·1024程序员节·磁盘取证
unable code8 天前
磁盘取证-ColorfulDisk
网络安全·ctf·misc·1024程序员节·内存取证
unable code9 天前
磁盘取证-[第十章][10.1.2 磁盘取证方法]磁盘取证1
网络安全·ctf·misc·1024程序员节·内存取证
开开心心就好10 天前
免费抽奖工具支持批量导入+自定义主题
linux·运维·服务器·macos·pdf·phpstorm·1024程序员节
Timmylyx051812 天前
Codeforces Round 1075 (Div. 2) 题解
算法·codeforces·比赛日记
开开心心就好14 天前
卸载工具清理残留,检测垃圾颜色标识状态
linux·运维·服务器·python·安全·tornado·1024程序员节
子燕若水15 天前
Facebook reels 运营指南
1024程序员节
尘觉18 天前
创作 1024 天|把热爱写成长期主义
数据库·1024程序员节
写点什么呢19 天前
Word使用记录
word·1024程序员节