BestCoder27 1001.Jump and jump ... (HDU 5162) Problem Solving report

Source: Internet
Author: User

Title Link: http://acm.hdu.edu.cn/showproblem.php?pid=5162

The title means: There are n kid, each kid has three grades A, B, C. Pick one of the biggest results as the kid's final result. Then rank them according to each kid's final score.

The game is very ugly, this is more pleasing to the eye .... Oh

1#include <iostream>2#include <cstdio>3#include <cstdlib>4#include <cstring>5#include <algorithm>6 using namespacestd;7 8 Const intMAXN =5+2;9 structnodeTen { One     intID; A     intscore; -     BOOL operator< (ConstNode &a)Const { -         returnScore >A.score; the     } - }KID[MAXN]; - intANS[MAXN]; -  + intMain () - { +    intT, N,inch; A     while(SCANF ("%d", &t)! =EOF) { at         while(t--) { -memset (ans,0,sizeof(ans)); -scanf"%d", &n); -             for(inti =0; I < n; i++) { -                intMaxx =-1; -                 for(intj =0; J <3; J + +) { inscanf"%d", &inch); -Maxx = Max (Maxx,inch); to                } +Kid[i].id = i+1; -Kid[i].score =Maxx; the            } *Sort (Kid, kid+n); $             for(inti =0; I < n; i++)Panax NotoginsengAns[kid[i].id] = i+1; -             for(inti =1; I <= N; i++) theprintf"%d%c", ans[i], i = = n?'\ n':' '); +        } A    } the    return 0; +}

BestCoder27 1001.Jump and jump ... (HDU 5162) Problem Solving report

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.