[Offer收割]编程练习赛28 register

Ended

Participants:277

Verdict:Accepted
Score:100 / 100
Submitted:2017-09-24 12:13:53

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<bits/stdc++.h>
#define pb push_back
typedef long long ll;
using namespace std;
typedef pair<int, int> pii;
const int maxn = 1e3 + 10;
string a;
void solve() {
    cin >> a;
    set<char> se= {a[0], a[1], a[3], a[4], a[6], a[7] };
    vector<char> v;
    int sx = (a[0] - '0') * 10 + a[1] - '0';
    int sy = (a[3] - '0') * 10 + a[4] - '0';
    int sz = (a[6] - '0') * 10 + a[7] - '0';
    int s = (sx * 60 + sy) * 60 + sz;
    //cout << sx << " " << sy << " " << s <<endl;
    int res = INT_MAX, r1, r2, r3;
    for (char t : se) v.push_back(t);
    if(v.size() == 1) {
        cout << a << endl;
        return;
    }
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v.size(); j++) {
            for (int x = 0; x < v.size(); x++) {
                for (int y = 0; y < v.size(); y++) {
                    for (int cx = 0; cx < v.size(); cx++) {
                        for (int cy = 0; cy < v.size(); cy++) {
                                int tx = (v[i] - '0') * 10 + v[j] - '0';
                                int ty = (v[x] - '0') * 10 + v[y] - '0';
                                int tz = (v[cx] - '0') * 10 + v[cy] - '0';
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX