链接: https://vjudge.net/problem/LightOJ-1354 题意: An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two IP addresses, first one in decimal form and secon…
1354 - IP Checking PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two I…
1354 - IP Checking PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB An IP address is a 32 bit address formatted in the following way a.b.c.d where a, b, c, d are integers each ranging from 0 to 255. Now you are given two I…
一.Description Suppose you are reading byte streams from any device, representing IP addresses. Your task is to convert a 32 characters long sequence of '1s' and '0s' (bits) to a dotted decimal format. A dotted decimal format for an IP address is form…
lightoj 1020 A Childhood Game 链接:http://lightoj.com/volume_showproblem.php?problem=1020 题意:一堆石子有 m 个,Alice和Bob可以从中取1个或者2个,如果Alice先取,最后取的人败:如果Bob先取,最后取的人胜.问胜利者. 思路:枚举前几个石子的情况,很容易找出每种情况的必败点,找规律.如果Alice先取,Alice的必败点为mod 3 == 1,如果Bob先取,Bob必败点在 mod 3 == 0处…
#include <iostream> #include <cstdio> #include <cmath> using namespace std; const int maxN = 100005; int a[maxN]; int t, tt; int n, q, x, y; int Bsearch_lower_bound(int x) { int l = 0, r = n - 1, mid = 0; while (l <= r) { mid = (l + r…