hihoCoder太阁最新面经算法竞赛12 register

Ended

Participants:164

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-26 01:21:23

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
struct node
{
    int t, z;
};
bool cmp(node a, node b)
{
    return a.z < b.z;
}
int calc(int a, int b, int c, int d)
{
    if ((a<2 || (a==2 && b < 4)) && c<6) return (a*10+b)*60+c*10+d;
    return -1;
}
int main()
{
    node t[4];
    int ans[4], maxt = -1, temp;
    for (int i = 0; i < 4; i++) cin >> t[i].t, t[i].z = i;
    do {
        temp = calc(t[0].t, t[1].t, t[2].t, t[3].t);
        if (maxt < temp)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX