[Acm 2022] audition Actress

* Problem:
Problem the Description
potato teacher though very like teaching, but forced by the pressure of life, had to find a way to pin money to support their families in their spare time.
"What do compare money? Sieve sand out of strength, and handsome enough to see the door ..." potato teacher was very helpless.
"Zhang Yimou also ugly than you are, how rich it now, I heard it also directed the opening ceremony of the Olympic Games! Why do not you go the entertainment industry do?" Lwg ideas aside.
Ah, too, in order to survive, it wronged point to the entertainment fry it, immediately shoot a laser movie "Hang electric memories - come back to my love."
Went ahead, Ma Shanghai election actress (and Lao Mouzai school, a move that could attract media attention, huh), and special provisions, ac actor must have the basic skills, or else directly out!
Since fish planner Wind (water master Wang) publicity in place, a lot of candidates to MM, of course, including the loud voice of beauty nit cake sister, and even the zjut of jqw are men dressed as women to apply for (better security adviser hdu_Bin-Laden is recognized , to Hongzou), it seems attractive entertainment further than what ... acm
interview day, just to the m
n-th MM, stand in a m
n-queue, the sub-director Fe (OH) 2 for each beat MM grade, which are 32-bit signed integer.
At first I wondered: how there are negative points? Fe (OH) 2 explained that, according to the selection rules, dyed yellow hair, makeup is too strong, too little to wear and so must buckle score, deduction may be more negative points, of course, if the words found Japanese in the folder, directly to -2147483648 divided.
Brought to score, and when I make a decision, and one of my selection principle is to choose a fraction interview absolute value (must or 32-bit integer) the biggest MM.
Special Note: If, unfortunately, select a negative score of MM, it does not matter, because I think, if you can not appeal to you, that you should disgusting idea.

Input
Input plurality of sets of data, the first line of each of the two integers m and n, the total number of rows of MM candidates, and m is an integer of rows, each row of n, m, and n are as defined topic description.

Output
For each case, three output integers x, y and s, respectively MM selected row number, column number and a fraction.
note: the row and column numbers from the beginning, if there are a plurality of scores as the absolute value MM, the output at the top of a (i.e., the smallest line number that, if the line number is the same as the minimum number of columns that take).

Sample Input
2 3
1 4 -3
-7 3 0

Sample Output
2 1 -7***

Code:

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int m,n;//行和列
	
 while(scanf("%d%d",&m,&n)!=EOF){
int l=1,r=1;//标记行和列 
	int max=0;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
		 int t;
		 cin>>t;
		 if(t>=0){
		 	if(t>abs(max)){
		 		max=t;
		 	
		 		l=i;
		 		r=j;
		 		//value=t;
			 }
		 }else {
		 	if(abs(t)>abs(max)){
		 	
		 		max=t;
		 		l=i;
		 		r=j;
		 		//value=t;
			 }
		 }
		 
	}
		 
	} 
	cout<<l<<" "<<r<<" "<<max<<endl;
}
	return 0; 
} 

Analysis: here directly from the first set to the maximum number, and only when it is converted back has a value larger than the max, is equal to the time required to judge

Published 42 original articles · won praise 18 · views 398

Guess you like

Origin blog.csdn.net/weixin_42918559/article/details/104063712