142. Keyword time limit per test: 0.5 sec. memory limit per test: 16384 KB Kevin has invented a new algorithm to crypt and decrypt messages, which he thinks is unbeatable. The algorithm uses a very large key-string, out of which a keyword is found ou…
Description Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday, Harry Potter has to go back to uncle Vernon's home. But he can't bring his precious with him. As you know, uncle Ve…
/********************************************************************************* * Refused to execute inline event handler because it violates the following Content Security Policy directive: "xxx". Either the 'unsafe-inline' keyword, a hash (…
NoReverseMatch at /salesman/zhuce/ Reverse for '/zhuce/' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 对于上面的错误,有可能是django模板的错误,下面我粘贴出来错误的配置代码 一. 错误代码,错误部门用红色字体标出错误配置 <div id ="user"> <form action="…
Description Math Olympiad is called “Aoshu” in China. Aoshu is very popular in elementary schools. Nowadays, Aoshu is getting more and more difficult. Here is a classic Aoshu problem: ABBDE __ ABCCC = BDBDE In the equation above, a letter stands for…
125. Shtirlits time limit per test: 0.25 sec. memory limit per test: 4096 KB There is a checkered field of size N x N cells (1 Ј N Ј 3). Each cell designates the territory of a state (i.e. N2 states). Each state has an army. Let A [i, j] be the numbe…
111.Very simple problem time limit per test: 0.5 sec. memory limit per test: 4096 KB You are given natural number X. Find such maximum integer number that it square is not greater than X. Input Input file contains number X (1≤X≤101000). Output Write…
Help Me with the Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3510 Accepted: 2251 Description Your task is to read a picture of a chessboard position and print it in the chess notation. Input The input consists of an ASCII-art…
Description Students often have problems taking up seats. When two students want the same seat, a quarrel will probably begin. It will have very bad effect when such subjects occur on the BBS. So, we urgently need a seat-taking-up rule. After several…
144. Meeting time limit per test: 0.25 sec. memory limit per test: 4096 KB Two of the three members of the winning team of one of the ACM regional contests are going to meet in order to train for the upcoming World Finals. They decided that they will…
139. Help Needed! time limit per test: 0.25 sec. memory limit per test: 4096 KB Little Johnny likes puzzles a lot! Just a few days ago, he found out about the 'traditional' 4x4 puzzle. For this puzzle, you have all the numbers from 0 to 15 arranged i…
112. a^b-b^a time limit per test: 0.25 sec. memory limit per test: 4096 KB You are given natural numbers a and b. Find a^b-b^a. Input Input contains numbers a and b (1≤a,b≤100). Output Write answer to output. Sample Input 2 3Sample Output -1 import j…
Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8905 Accepted: 2969 Description The Borg is an immensely powerful race of enhanced humanoids from the delta quadrant of the galaxy. The Borg collective is the term used to descr…
<传送门> 128. Snake time limit per test: 0.25 sec. memory limit per test: 4096 KB There are N points given by their coordinates on a plane. All coordinates (xi,yi) are integers in a range from -10000 up to 10000 inclusive . It is necessary to construct…
https://leetcode.com/problems/zigzag-conversion/ The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y…
https://leetcode.com/problems/bitwise-and-of-numbers-range/ [n,m]区间的合取总值就是n,m对齐后前面一段相同的数位的值 比如 5:101 7:111 结果就是 4:100 class Solution { public: int rangeBitwiseAnd(int m, int n) { int len = 0; long long tmp = 1; for(;tmp <= n || tmp <= m;len++){tmp&l…
https://leetcode.com/problems/add-two-numbers/ You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked…
https://leetcode.com/problems/two-sum/ class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> index(2,0); vector<int> n2; int numsSize = nums.size(); int f = -1; for(int i = 0;i < numsSize;i…
https://leetcode.com/problems/excel-sheet-column-number/ class Solution { public: int titleToNumber(string s) { int ans = 0; for(int i = 0;i < s.length();i++) { ans *= 26; ans += s[i] - 'A' + 1; } return ans; } };…
http://poj.org/problem?id=1125 #include <iostream> #include <cstring> using namespace std; int d[101][101];// dag ATTENTION int num[101];//the number of contracts int edge[101][101];// adjecent edge table int n;//always represent the maxnum of…