Problem Description有兩堆石子,數量任意,可以不同。遊戲開始由兩個人輪流取石子。遊戲規定,每次有兩種不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以在兩堆中同時取走相同數量的石子。最後把石子全部取完者為勝者。現在給出初始的兩堆石子的數目,如果輪到你先取,假設雙方都採取最好的策略,問最後你是勝者還是敗者。如果你勝,你第1次怎樣取子? Input 輸入包含若干行,表示若干種石子的初始情況,其中每一行包含兩個非負整數a和b,表示兩堆石子的數目,a和b都不大於1,000,
http://acm.hdu.edu.cn/showproblem.php?pid=4282今年網路賽。。天津賽區。。有道題。。是這樣的。。。X^Z + Y^Z + XYZ = K 給出K ,求XYZ,我思路很明確。。。枚舉其二,然後二分其一,但是始終TLE。。。。晚上回去之後,看了人家報告,。。。才發現。。。原來是微軟的函數pow惹的禍。。。我本來以為微軟的函數寫的都很好。。效率很高。。但是我忘了一件事。。就是 pow(int a, int b) 這個函數可以理解為 pow(double
Problem DescriptionSpeakless很早就想出國,現在他已經考完了所有需要的考試,準備了所有要準備的材料,於是,便需要去申請學校了。要申請國外的任何大學,你都要交納一定的申請費用,這可是很驚人的。Speakless沒有多少錢,總共只攢了n萬美元。他將在m個學校中選擇若干的(當然要在他的經濟承受範圍內)。每個學校都有不同的申請費用a(萬美元),並且Speakless估計了他得到這個學校offer的可能性b。不同學校之間是否得到offer不會互相影響。“I NEED A
Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study.Of course,the profit he will gain from different course depending on the days he spend on it.How to arrange the M days for the N courses to maximize the
題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=3448題目大意:Problem Description0/1 bag problem should sound familiar to everybody. Every earth man knows it well. Here is a mutant: given the capacity of a bag, that is to say, the number of goods the bag
A + B Problem IITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 168320 Accepted Submission(s): 32254Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is