2015 Suzhou University ACM-ICPC Training Team Tryouts (2) 1001 1010

Source: Internet
Author: User

Master of the Grass time limit:3000/1000ms (java/other) Memory limit:65535/32768k (Java/other) total submission (s): KT Accepted S Ubmission (s): 26font:times New Roman | Verdana | Georgiafont Size:←→problem Description Suzhou University team again diligently began the training.
Today opened a 5-hour team training tournament, Suzhou University's N (1<=n<=100) school team struggling to fight (Hua) (shui), each team has made a K (1<=k<=10) problem, but because the penalty when there are differences, so the ranking is different.
Now give each team the AC, please follow the penalty from less to more output each team's penalty.

The ranking rules are as follows:
1, if the number of AC problems are different, the number of the problem of the team ranked before;
2, if the number of AC is the same, then according to the amount of penalty, the total penalty is less than the rank of the front.
The rule of penalty is as follows:
1, each topic only when it is at the time of the penalty when the total penalty, the total penalty for each AC subject of the basis of penalties and the sum of penalties;
2. The base penalty for each AC topic is the number of minutes from the beginning of the contest to the AC;
3. The penalty for each AC issue is: each error submitted prior to the first AC (including WA, RE, TLE, MLE, etc.) will be added to the penalty for an additional 20 minutes. Input multiple sets of data (<=100), read to the end of the file.
Each set of data begins with two integers n and K;
The next number of times for the N-team and the submission times, each team accounted for two lines:
The first behavior of each team K time, Format (XX:YY), the first I time to represent the first topic AC time for XX hours yy minutes.
The second act of each team k integers, and the first integer indicates the total number of commits of the first I a[i] (1<=a[i]<=200, total number of times including one AC submission);
The data guarantees that the total penalty is within a 32-bit integer, and that the problem is not submitted after each team has a topic AC. Output one line for each set of inputs:
According to the penalty time of the training game, from less to more output the total penalty time of each team (minutes), every two numbers separated by a space. Sample Input
3 500:59 00:25 04:16 00:12 03:571 2 1 1 301:03 00:17 02:38 00:22 02:081 1 1 1 100:44 00:29 03:42 00:20 01:531 1 3 1 11 700 : 27 01:58 03:15 00:47 02:44 04:13 02:392 1 4 4 1 7 44 302:12 00:42 00:244 1 101:27 03:03 00:311 2 100:58 00:33 00:181 1 10 4:05 00:41 01:276 2 4
Sample Output
388 468 6491283109 258 321 553
Author Shang a very simple simulation, pay attention to the time conversion is good
#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <math.h> #include <sstream> #include <set> #include <queue> #include <map> #include < vector> #include <algorithm> #include <limits.h> #define INF 0x3fffffff#define inf 0x3f3f3f3f#define Lson L,m,rt<<1#define Rson m+1,r,rt<<1|1#define LL long long#define ULL unsigned long longusing namespace Std;stru    CT p{//string s; int sum;} L[100000];int i,j;int n,m;int k;int m,s;int fa;bool cmd (P x,p y) {return x.sum<y.sum;}            int main () {while (cin>>n>>k) {for (j=0;j<n;j++) {int num=0;                for (i=0; i<k; i++) {scanf ("%d:%d", &m,&s);            Num+=m*60+s;                } for (i=0; i<k; i++) {cin>>fa;            num+= (FA-1) *20;           } L[j].sum=num; Cout<<l[j].sum<<endl;        } sort (l,l+n,cmd);            for (i=0;i<n;i++) {if (i!=n-1) {printf ("%d", l[i].sum);            } else {printf ("%d\n", l[i].sum); }}} return 0;}

  

High energy math problem Time limit:2000/1000ms (java/other) Memory limit:65535/32768k (Java/other) total submission (s): Accepted s Ubmission (s): 38font:times New Roman | Verdana | Georgiafont Size:←→problem Description Given a positive integer n, judging whether the number is a multiple of 3 input data has multiple groups (about 300 groups). One positive integer n (0<n<=10^10000) output per line for each set of input data, a single line of "Yes" or "no" (excluding quotation marks), indicating whether N is a multiple of 3, sample input
11234567892333333333333333333333333333333333333333
Sample Output
Noyesno
Author high can climb the sum of each digit to see if divisible by 3
#include <stdio.h>//#include <bits/stdc++.h> #include <string.h> #include <iostream> #include <math.h> #include <sstream> #include <set> #include <queue> #include <map> #include < vector> #include <algorithm> #include <limits.h> #define INF 0x3fffffff#define inf 0x3f3f3f3f#define Lson L,m,rt<<1#define Rson m+1,r,rt<<1|1#define LL long long#define ULL unsigned long longusing namespace Std;stri ng S;int Main () {    while (cin>>s)    {        int sum=0;        for (int i=0;i<s.length (); i++)        {            sum+=s[i]-' 0 ';        }      cout<<sum<<endl;      if (sum%3==0)      {          puts ("Yes");      }      Else      {          puts ("No");      }    }    return 0;}

  

2015 Suzhou University ACM-ICPC Training Team Tryouts (2) 1001 1010

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.