现在位置: 首页 > 算法 > 文章
2019年04月12日 算法 ⁄ 共 2378字 评论关闭
Sudoku Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 12594   Accepted: 6275   Special Judge Description Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with ...
阅读全文
2019年04月12日 算法 ⁄ 共 3826字 评论关闭
Gap Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 1595   Accepted: 724 Description Let's play a card game called Gap.  You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents the value of the card.  First, you shu2e the cards and lay them face up on the table in...
阅读全文
2019年04月12日 算法 ⁄ 共 3586字 评论关闭
Escape from Enemy Territory Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 2301   Accepted: 637 Description A small group of commandos has infiltrated deep into enemy territory. They have just accomplished their mission and now have to return to their rendezvous point. Of course they don’t want to get caught even if the mission is already over. Therefore they dec...
阅读全文
2019年04月12日 算法 ⁄ 共 3663字 评论关闭
The Game Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8640   Accepted: 2632 Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?'' So you decide to write a computer game.  The game takes place on a rectangular board consisting of w * h squares. Each square might or might not contain a game piece, as shown in the ...
阅读全文
2019年04月12日 算法 ⁄ 共 2795字 评论关闭
Power Calculus Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 1615   Accepted: 856 Description Starting with x and repeatedly multiplying by x, we can compute x31 with thirty multiplications: x2 = x × x, x3 = x2 × x, x4 = x3 × x, …, x31 = x30 × x. The operation of squaring can be appreciably shorten the sequence of multiplications. The following is a way to com...
阅读全文
2019年04月12日 算法 ⁄ 共 4450字 评论关闭
Eight Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 10351    Accepted Submission(s): 2755Special Judge Problem Description The 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by ...
阅读全文
2019年04月12日 算法 ⁄ 共 3643字 评论关闭
Sudoku Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8152   Accepted: 2862 Description In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, . 2 7 3 8 . . 1 . . 1 . . . 6 7 3 5 . . . . . . . 2 9 3 . 5 6 9 2 . 8 . . . . . . . . . . . 6 . 1 7 4 5 . 3 6 4 . . . . . . . 9 5 1 8 . . . 7 . ...
阅读全文
2019年04月12日 算法 ⁄ 共 5752字 评论关闭
Dynamic Rankings Time Limit: 10 Seconds      Memory Limit: 32768 KB The Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find the k-th smallest number of the given N numbers. They have developed a more powerful system such that for N numbers a[1], a[2], ..., a[N], you can ask it like: what is the k-th smallest number of...
阅读全文
2019年04月11日 算法 ⁄ 共 1212字 评论关闭
1026: [SCOI2009]windy数 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 2615  Solved: 1155 [Submit][Status] Description windy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。 windy想知道,在A和B之间,包括A和B,总共有多少个windy数? Input 包含两个整数,A B。 Output 一个整数。 Sample Input 【输入样例一】 1 10 【输入样例二】 25 50 Sample Output 【输出样例一】 9...
阅读全文
2019年04月11日 算法 ⁄ 共 1091字 评论关闭
之前用指针存叶节点以为能少一遍遍历  结果提交上去还慢一些! 思路:一开始看到这道题觉得应该是链表 但是时间复杂度太高了(是我太嫩了 -  -) 怎么才能按要求排好序呢?答案是看题解..好吧..记住有这种用法就好了.. #include <cstdio> #include <cstring> #include <algorithm> #define lson num<<1 #define rson num<<1|1 #define gl l,(l+r)>>1,lson #define gr ((l+r)>>1)+1,r...
阅读全文