Topic Portal
1 /*2 violence: This problem is really drunk, direct violence unexpectedly can! Complexity does not analyze, dare not write violent program. 3 enumeration X, +ans in the case of non-repetition, with a direct break beyond the range4 */5#include <cstdio>6#include <algorithm>7#include <cstring>8#include <cmath>9 using namespacestd;Ten OnetypedefLong Longll; A Const intMAXN = 1e7 +Ten; - Const intINF =0x3f3f3f3f; - BOOLVIS[MAXN]; the - intMainvoid)//Hihocoder 1178 Count - { - //freopen ("b.in", "R", stdin); + - ll N, L, R; + while(SCANF ("%lld", &n) = =1) A { at if(n = =0) Break; -scanf ("%lld%lld", &l, &R); -memset (Vis,false,sizeof(Vis)); - - intAns =0; - for(LL i=1; i<=5e7; ++i) in { -ll tmp = i ^ (n *i); to if(TMP >= L && tmp <= R) {if(!vis[tmp]) {Vis[tmp] =true; ans++;}} + } - theprintf ("%d\n", ans); * } $ Panax Notoginseng return 0; -}
Violence Hihocoder 1178 Count