Title Link: http://hihocoder.com/problemset/problem/1223
This problem is not difficult, the difficulty lies in the processing of decimals. Either 0.5 is a step enumeration, or you can enlarge an even multiple enumeration.
1 /*2 ━━━━━┒ギリギリ♂eye! 3 ┓┏┓┏┓┃キリキリ♂mind! 4 ┛┗┛┗┛┃\0/5 ┓┏┓┏┓┃/6 ┛┗┛┗┛┃ノ)7 ┓┏┓┏┓┃8 ┛┗┛┗┛┃9 ┓┏┓┏┓┃Ten ┛┗┛┗┛┃ One ┓┏┓┏┓┃ A ┛┗┛┗┛┃ - ┓┏┓┏┓┃ - ┃┃┃┃┃┃ the ┻┻┻┻┻┻ - */ -#include <algorithm> -#include <iostream> +#include <iomanip> -#include <cstring> +#include <climits> A#include <complex> at#include <cassert> -#include <cstdio> -#include <bitset> -#include <vector> -#include <deque> -#include <queue> in#include <stack> -#include <ctime> to#include <Set> +#include <map> -#include <cmath> the using namespacestd; * #defineFr First $ #defineSC SecondPanax Notoginseng #defineCL Clear - #defineBUG puts ("Here!!!") the #defineW (a) while (a--) + #definePB (a) push_back (a) A #defineRint (a) scanf ("%d", &a) the #defineRll (a) scanf ("%i64d", &a) + #defineRs (a) scanf ("%s", a) - #defineCIN (a) CIN >> a $ #defineFRead () freopen ("in", "R", stdin) $ #defineFWrite () freopen ("Out", "w", stdout) - #defineRep (i, Len) for (int i = 0; i < (len); i++) - #defineFor (I, A, Len) for (int i = (a); I < (len); i++) the #defineCls (a) memset ((a), 0, sizeof (a)) - #defineCLR (A, X) memset ((a), (x), sizeof (a))Wuyi #defineFull (a) memset ((a), 0x7f7f7f, sizeof (a)) the #defineLRT RT << 1 - #defineRRT RT << 1 | 1 Wu #definePi 3.14159265359 - #defineRT return About #defineLowbit (x) x & (-X) $ #defineOnenum (x) __builtin_popcount (x) -typedefLong LongLL; -typedefLong DoubleLD; -typedef unsignedLong LongULL; Atypedef pair<int,int>PII; +typedef pair<string,int>psi; thetypedef PAIR<LL, Ll>PLL; -typedef map<string,int>MSI; $typedef vector<int>VI; thetypedef vector<ll>VL; thetypedef vector<vl>VVL; thetypedef vector<BOOL>vb; the -typedefstructNode { in Charp[5]; the intC; the }node; About the Const intMAXN =1100; the intN; the Charqx[5]; + Node K[MAXN]; - the intMain () {Bayi //FRead (); the while(~Rint (n)) { the Cls (k); -for (I,1, n+1) { - Rs (QX); Rs (K[I].P); Rint (K[I].C); theK[I].C <<=2; the } the intRET =0; theFor (x,-1005,4005) { - intCur =0; thefor (I,1, n+1) { the intLen =strlen (K[I].P); the if(k[i].p[0] =='<'&& len = =1)94 if(x < K[I].C) cur++; the if(k[i].p[0] =='<'&& k[i].p[1] =='=') the if(x <= k[i].c) cur++; the if(k[i].p[0] =='='&& len = =1)98 if(x = = k[i].c) cur++; About if(k[i].p[0] =='>'&& len = =1) - if(x > K[i].c) cur++;101 if(k[i].p[0] =='>'&& k[i].p[1] =='=')102 if(x >= k[i].c) cur++;103 }104RET =Max (ret, cur); the }106printf"%d\n", ret);107 }108Rt0;109}
[HIHO1223] Inequalities (discretization, enumeration)