C++
文章平均质量分 89
cyberickk
这个作者很懒,什么都没留下…
展开
-
LeetCode 997 Find the Town Judge
997 Find the Town Judgehttps://leetcode.com/problems/find-the-town-judge/In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge.If the town judge exists, then:The town judge trusts nobo原创 2021-02-01 17:48:39 · 98 阅读 · 0 评论 -
PAT 甲级 1116 Come on! Let's C
1116 Come on! Let’s C“Let’s C” is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun, the aw...原创 2020-04-27 15:39:49 · 109 阅读 · 0 评论 -
PAT 甲级 1120 Friend Numbers
1120 Friend NumbersTwo integers are called “friend numbers” if they share the same sum of their digits, and the sum is their “friend ID”. For example, 123 and 51 are friend numbers since 1+2+3 = 5+1 ...原创 2020-04-26 22:30:15 · 86 阅读 · 0 评论 -
PAT 甲级1148 Werewolf - Simple Version
1148 Werewolf - Simple VersionWerewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: “Player #2 i...原创 2020-04-21 17:57:44 · 130 阅读 · 0 评论 -
PAT 甲级1140 Look-and-say Sequence
1140 Look-and-say SequenceLook-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)st number is a kind ...原创 2020-04-21 17:56:51 · 97 阅读 · 0 评论 -
PAT 甲级1136 A Delayed Palindrome
1136 A Delayed PalindromeConsider a positive integer N written in standard notation with k+1 digits a**i as a**k⋯a1a0 with 0≤a**i<10 for all i and a**k>0. Then N is palindromic if and only if a...原创 2020-04-21 17:55:43 · 141 阅读 · 0 评论 -
PAT 甲级1132 Cut Integer (20分)
1132 Cut Integer (20分)Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B =...原创 2020-04-21 17:54:34 · 114 阅读 · 0 评论 -
PAT 甲级 1128 N Queens Puzzle
1128 N Queens PuzzleThe “eight queens puzzle” is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens...原创 2020-04-21 17:53:13 · 104 阅读 · 0 评论 -
C++ map、unordered_map 插入元素的覆盖问题
#include <iostream>#include <map>#include <unordered_map>using namespace std;void test4() { map<int,int> m; unordered_map<int,int> um; m[1] = 0; m[1] = 1; cout ...原创 2020-03-25 11:04:53 · 6495 阅读 · 0 评论