题目链接: Bob and Alice are playing numbers DESCRIPTION Bob and his girl friend are playing game together.This game is like this: There are nn numbers. If op = 11,Bob wants to find two numbers aiai and ajaj,that aiai & ajaj will become maximum value. If…
1152 - Expected value of the expression Time Limit:2s Memory Limit:128MByte Submissions:128Solved:63 DESCRIPTION You are given an expression: A0O1A1O2A2⋯OnAnA0O1A1O2A2⋯OnAn, where Ai(0≤i≤n)Ai(0≤i≤n) represents number, Oi(1≤i≤n)Oi(1≤i≤n) represents op…
1014 - Absolute Defeat Time Limit:2s Memory Limit:64MByte Submissions:257Solved:73 DESCRIPTION Eric has an array of integers a1,a2,...,ana1,a2,...,an. Every time, he can choose a contiguous subsequence of length kk and increase every integer in the c…
1010 - Alarm Time Limit:1s Memory Limit:128MByte DESCRIPTION Given a number sequence [3,7,22,45,116,...] . Please tell me the k -th number. INPUT A number T (T<100) indicates the number of the input cases. Then for each case there only is one integer…
1050 - array Time Limit:3s Memory Limit:64MByte Submissions:494Solved:155 DESCRIPTION 2 array is an array, which looks like: 1,2,4,8,16,32,64......a1=1 ,a[i+1]/a[i]=2; Give you a number array, and your mission is to get the number of subsequences ,wh…
1052 - See car Time Limit:2s Memory Limit:64MByte Submissions:594Solved:227 DESCRIPTION You are the god of cars, standing at (a, b) point.There are some cars at point (xi,yi), . If lots of cars and you are in one line, you can only see the car that i…
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another comput…
点击传送 Alice’s Stamps Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1448 Accepted Submission(s): 501 Problem Description Alice likes to collect stamps. She is now at the post office buying so…
题目链接:http://acm.swust.edu.cn/problem/0648/ Time limit(ms): 1000 Memory limit(kb): 65535 有这样一本字典,它每个单词一页,单词没有相同字母. 就像这样: a 1 b 2 . . z 26 ab 27 . . az 51 ba 52 bc 53 . . Description 多组测试数据,每行是一个串长最大为10由小写字母组成的单词. 以EOF结束. Input 输出这个单词在这本字典的第几页 Output…
Implement a trie with insert, search, and startsWith methods. 实现字典树,前面好像有道题做过类似的东西,代码如下: class TrieNode { public: // Initialize your data structure here. TrieNode():isLeaf(false) { for(auto & t : dic){ t = NULL; } } TrieNode * dic[]; bool isLeaf; };…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15942 Accepted Submission(s): 11245 Problem Description "Well, it seems the first problem is too easy. I will let…