C. Tennis Championship time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There w…
Have you learned something about segment tree? If not, don't worry, I will explain it for you. Segment Tree is a kind of binary tree, it can be defined as this: - For each node u in Segment Tree, u has two values: $L_u$ and $R_u$. - If $L_u = R_u$…
A simple problem Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3702 Accepted Submission(s): 1383 Problem Description Zty很痴迷数学问题..一天,yifenfei出了个数学题想难倒他,让他回答1 / n.但Zty却回答不了^_^. 请大家编程帮助他. Input 第一行…
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 58072 Accepted: 18061 Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00…
#include<stdio.h> #include<string.h> int len, n, i, j; int d[100005], a[100005]; int binsearch(int x) { int l = 1, r = len, mid; while (l <= r) { mid = (l + r) >> 1; if (d[mid-1] <= x && x < d[mid]) return mid; else if (…
最近在学shell,记录一下. if语句的使用: 1.判断两个参数大小 #!/bin/sh #a test about if statement a=10 b=20 if [ $a -eq $b ];then echo "parameter a is equal to parameter b" elif [ $a -le $b ];then echo "parameter a is less than parameter b" elif [ $a -gt $b ];…