#include #include #define MIN(a,b) (((a) < (b)) ? (a) : (b))int main(){ int code[1000]; int guess[1000]; int C1[10]; // 数字1~9在code中出现的次数,C1[0]未使用 int ...
分类:
其他好文 时间:
2015-06-20 21:58:29
阅读次数:
144
Description从(0,0)走到(n,m),没走过一个点(x,y)贡献为C(x,y),求最小贡献和。Solution让我们guess一下走的路线一定是先走长的一边再走短的一边,两条直线然后就是求组合数了这个可以递推,除的时候用费马小定理解决Codeget到了pow更短的写法一开始m没取模溢出了...
分类:
其他好文 时间:
2015-06-19 01:28:23
阅读次数:
185
Well, there is a nice and succinct solution to this problem using math skills. However, personally I guess it would be safer to use DP in a coding int...
分类:
其他好文 时间:
2015-06-03 00:42:00
阅读次数:
157
I guess the punch line of this one is Sieving for primes.#include #include #include #include #include #include #include #include using namespace std;v...
分类:
其他好文 时间:
2015-05-28 02:01:14
阅读次数:
414
2015.5.25第一天下载Python IDLE,写个猜数字的小游戏来熟悉这门语言: 1 times=6 2 letters=[100] 3 for i in range(1,times): 4 a = input("input the number you guess:") 5 ...
分类:
编程语言 时间:
2015-05-26 09:08:06
阅读次数:
181
// uva 11995 数据结构
// 给你一些操作,确定是队列还是栈还是优先队列(数值大的优先级大)
// 简单题,练练基础吧相当于
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2015-05-17 12:21:40
阅读次数:
120
循环
loop关键字给我们一个无限循环。让我们添加它:
extern crate rand;
use std::io;
use std::cmp::Ordering;
use rand::Rng;
fn main() {
println!("Guess the number!");
...
分类:
其他好文 时间:
2015-05-13 10:21:05
阅读次数:
207
处理一次猜测
让我们继续!我们猜数字游戏需要做的第一步是允许玩家输入一个猜测的数字。将下面的代码输入到src/main.rs文件中:
use std::io;
fn main() {
println!("Guess the number!");
println!("Please input your guess....
分类:
其他好文 时间:
2015-05-13 08:47:45
阅读次数:
208
题目大意:有n个选手参加比赛,题目共有三道,现在给出n个选手每道题的得分和最后的排名,(每道题的得分依据最后检查是否通过来给分,如果没通过得0分,通过得到相应分),问最后一名选手能得到的最高分是多少。(得分相同,ID小的排前面)解体思路:要最高分,那第一名肯定要三道题都对。维护一个最高分和上一个人的ID号
接着判断一下下一名的得分,如果有得分相同的情况下,就判断一下ID号
如果当前这个人的ID号...
分类:
其他好文 时间:
2015-05-05 22:03:52
阅读次数:
148
描述
Number Guessing is a computer game. First, the computer chooses four different digits, you need to guess these four digits in the fewest times,for each guess, the computer will show a judgement ...
分类:
其他好文 时间:
2015-05-05 08:54:17
阅读次数:
139