首页 > 其他分享 >CodeForces - 616B Dinner with Emma (模拟)水

CodeForces - 616B Dinner with Emma (模拟)水

时间:2023-06-08 14:02:46浏览次数:55  
标签:Emma 616B dinner Dinner cost Jack include avenue

Time Limit: 1000MS

 

Memory Limit: 262144KB

 

64bit IO Format: %I64d & %I64u

CodeForces - 616B


Dinner with Emma



Submit Status




Description




Jack decides to invite Emma out for a dinner. Jack is a modest student, he doesn't want to go to an expensive restaurant. Emma is a girl with high taste, she prefers elite places.

Munhattan consists of n streets and m avenues. There is exactly one restaurant on the intersection of each street and avenue. The streets are numbered with integers from 1 to n and the avenues are numbered with integers from 1 to m. The cost of dinner in the restaurant at the intersection of the i-th street and the j-th avenue is cij.

Jack and Emma decide to choose the restaurant in the following way. Firstly Emma chooses the street to dinner and then Jack chooses the avenue. Emma and Jack makes their choice optimally: Emma wants to maximize the cost of the dinner, Jack wants to minimize it. Emma takes into account that Jack wants to minimize the cost of the dinner. Find the cost of the dinner for the couple in love.






Input




The first line contains two integers n, m (1 ≤ n, m ≤ 100) — the number of streets and avenues in Munhattan.

Each of the next n lines contains m integers cij (1 ≤ cij ≤ 109) — the cost of the dinner in the restaurant on the intersection of the i-th street and the j-th avenue.






Output




Print the only integer a






Sample Input





Input



3 44 1 3 52 2 2 25 4 5 1





Output



2





Input



3 31 2 32 3 13 1 2





Output



1







Hint




In the first example if Emma chooses the first or the third streets Jack can choose an avenue with the cost of the dinner 1. So she chooses the second street and Jack chooses any avenue. The cost of the dinner is 2.

In the second example regardless of Emma's choice Jack can choose a restaurant with the cost of the dinner 1.




Source



Educational Codeforces Round 5



//题意:输入n,m;表示有n条街,每条街有m家饭店,每条街都有一家是最便宜的,问这n个最便宜中的最贵的是多少。




#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stack>
#include<queue>
#include<math.h>
#define INF 0x3f3f3f3f
#define ull unsigned long long
#define ll long long
#define IN __int64
#define N 100010
#define M 1000000007
using namespace std;
int main()
{
	int n,m,i,j;
	int mi,ma,mm;
	while(scanf("%d%d",&n,&m)!=EOF)
	{
		ma=0;
		for(i=0;i<n;i++)
		{
			mi=INF;
			for(j=0;j<m;j++)
			{
				scanf("%d",&mm);
				mi=min(mi,mm);
			}
			ma=max(ma,mi);
		}
		printf("%d\n",ma);
	}
	return 0;
}




标签:Emma,616B,dinner,Dinner,cost,Jack,include,avenue
From: https://blog.51cto.com/u_16079508/6439519

相关文章

  • 证明霍夫丁引理 Hoeffding Lemma
    马尔可夫不等式(Markov'sinequality)\(X\ge0\)为非负随机变量,\(t>0\)为常数,则有\[\begin{align*}\mathbbP(X\get)\le{\mathbbEX\overt}\end{align*}\]证:指示器函数\(I\lbraceA\rbrace=\begin{cases}1&\text{if}A\\0&\text{else}\end{cases}......
  • CF1567E Non-Decreasing Dilemma 题解 线段树
    题目链接:http://codeforces.com/problemset/problem/1567/E题目大意:有一个长度为\(n\)的数列\(a\),你需要对其进行\(q\)次操作,操作有两种类型,按如下格式给出:1xy:......
  • 《Towards Cooperation in Sequential Prisoner’s Dilemmas: a Deep Multiagent Rein
    致力于序贯囚徒困境中的合作:一种多智能体深度强化学习的方法总结主要是针对复杂的序贯囚徒困境的合作提出的方法,目的是为了提高合作程度最终达到提高社会总收益的。该方......
  • 《LEARNING HOMOPHILIC INCENTIVES IN SEQUENTIAL SOCIAL DILEMMAS》 2022-ICLR
    在序贯社会困境中学习同质性激励总结:由于在类似harvest这种困境中,带有惩罚功能的智能体惩罚他人会付出代价,由此可能引发第二层级的搭便车行为,即都不想进行惩罚动作付出小......
  • POJ 2249 : Remmarguts' Date
    #include<iostream>#include<queue>#include<vector>usingnamespacestd;constintN=100000*2+1;#definempmake_pair#definepiipair<int,int>......
  • POJ 2249 Remmarguts' Date
    #include<iostream>#include<vector>#include<queue>#include<cstring>#include<string>usingnamespacestd;typedeflonglongll;constllN=1e5+1111;......
  • 定理(Theorem)、引理(Lemma)、推论(Corollary)的区别
    名詞解釋Theorem:就是定理,比較重要的,簡寫是Thm。Lemma:小小的定理,通常是為了證明後面的定理,如果證明的篇幅很長時,可能會把證明拆成幾個部分來敘述,雖然篇幅可能變多,但脈絡......
  • 《Learning to Resolve Alliance Dilemmas in Many-Player Zero-Sum Games》 2020-AAM
    学习解决多人零和博弈中的联盟困境总结:将两人的零和博弈扩展到多人零和博弈,并将多人零和博弈中的联盟问题转为社会困境问题用基于强化学习的方法进行解决。先是说明了一......
  • 《Consequentialist Conditional Cooperation in Social Dilemmas with Imperfect Inf
    环境:Fishery:湖两岸有两个钓鱼人互相观察不到对方的动作,湖里有幼鱼和成熟鱼奖励分别为1和2,鱼游到对岸变成成熟鱼。合作方案即将幼鱼放给对岸,背叛即被诱惑吊幼鱼。PongPl......
  • A Lemma of Borel
    Lemma(Borel).If\(g_1,\cdots,g_n\)areentirefunctionssuchthat\[e^{g_1}+\cdots+e^{g_n}=1\]thensome\(g_i\)isconstant.(Equivalently,theredonoexis......