hiho week 80 register

Ended

Participants:173

Verdict:Accepted
Score:100 / 100
Submitted:2016-01-12 11:00:54

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 <iostream>
#include <limits>
#include <cstring>
#define mmax(a, b) ((a) > (b)) ? (a) : (b)
using namespace std;
int nums[3];
int arr[3];
int cntR, cntY, cntB;
char charArr[20000];
int maximum = numeric_limits<int>::min();
int compare(const void* a, const void* b)
{
    return (*(int*)a - *(int*)b);
}
bool isMatch()
{
    arr[0] = abs(cntR - cntB);
    arr[1] = abs(cntR - cntY);
    arr[2] = abs(cntB - cntY);
    qsort(arr, 3, sizeof(int), compare);
    //cout << cntR << cntB << cntY << endl;
    for (int i = 0; i < 3; i++)
    {
        //cout << arr[i] << " vs " << nums[i] << endl;
        if (arr[i] != nums[i])
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX