Hdu 2022 Audition actress (Java)

Source: Internet
Author: User

Problem:

When the maximum value is not noticed when the negative value is replaced by a later positive value, for example, when the maximum is 7, the direct 7 is assigned to Max, then the max=-7 will be replaced by the following 2, because 2>-7, after setting the value of the maximum value of the other. When errors occur, you can take each of them into the program to troubleshoot errors.

When you do not need to output a group of numbers, you should prioritize anger without arrays, which can reduce an input for loop.


Audition actressTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 40376 Accepted Submission (s): 18108


Problem Descriptionpotato teacher, although very fond of teaching, but under the pressure of life, have to find ways to earn some extra money in their spare time to feed their families.
"What do you do to make money?" Sieve the sand without strength, look at the door and not handsome ... "potato teacher is very helpless."
"Zhang Yimou is more ugly than you, now more money ah, heard also to director the Olympic Opening Ceremony!" Why don't you go to the entertainment industry? LWG in the side to advise.
Well, also, in order to survive, the injustice point to the entertainment Circle Gang, immediately on a laser film "Hangzhou Electric Memory-back my love."
Say dry, immediately audition actress (and the old son learn, this can attract the media eyeball, hehe), and special provisions, actors must have the basic skills of AC, otherwise directly out!
Because of the planning of the fish (master Water King) propaganda in place, to apply for a lot of mm, of course, including nit cake sister, such as the voice of high beauty, even zjut jqw are men disguised as women to apply (fortunately by the security adviser Hdu_bin-laden recognized, to blow away), It seems the entertainment circle is more attractive than ACM ...
The interview day, just came m*n mm, standing in a m*n queue, Deputy director Fe (OH) 2 for each MM score, scores are 32-bit signed integers.
At first I was wondering: How did the score get negative? Fe (OH) 2 explained that, according to the selection rules, hair dyed yellow, make-up too thick, too little wear and so on to buckle scores, buckle more may be negative points, of course, if found in the words in Japanese, directly to-2147483648 points.
Score sent up, it is time for me to make a decision, one of my selection principle is to choose an interview score absolute value (must or 32-bit integer) the largest mm.
Special Note: If the unfortunate selection of a negative mm, it does not matter, because I think, if not attract you, it is disgusting you.

Input data has more than one group, the first line of each group is two integers m and N, representing the total number of rows for mm, followed by M-line integers, each line has n, m and n definitions see the title description.

Output for each set of input data, outputs three integers, x, y, and S, each representing the line number, column number, and fraction of the selected mm.
Note: The line number and column number from the beginning, if there are more than one mm of the absolute value of the same, then the output of the first one (the smallest row number, if the line number is the same as the smallest column number).

Sample Input
2 31 4-3-7 3 0

Sample Output
2 1-7 Code:
Import java.util.*;p ublic class main{static int ABSs (int a) {return A>0?a: (-a);} public static void Main (String args[]) {Scanner cin=new Scanner (system.in); int n,m;int Max,ans;int x = 0,y=0,z=0;while (cin . Hasnext ()) {n=cin.nextint (); M=cin.nextint (); max=-1;ans=0;for (int i=1;i<=n;i++) {for (int j=1;j<=m;j++) {z= Cin.nextint (); if (MAX<ABSS (z)) {MAX=ABSS (z); ans=z;x=i;y=j;}}} System.out.println (x+ "" +y+ "" +ans);}}}


Hdu 2022 Audition actress (Java)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.