Feature:PAT真题练习
@kidultff

PAT-A 真题- 1032. Sharing

题干:To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same suffix. For example, "loading" and "being" ...
  • 0
  • 1
@kidultff

PAT-A 真题- 1051. Pop Sequence

题干:Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, ...
  • 0
  • 0
@kidultff

PAT-B 真题- 1071. 小赌怡情

常言道"小赌怡情"。这是一个很简单的小游戏:首先由计算机给出第一个整数;然后玩家下注赌第二个整数将会比第一个数大还是小;玩家下注t个筹码后,计算机给出第二个数。若玩家猜对了,则系统奖励玩家t个筹码;否则扣除玩家t个筹码。注意:玩家下注 ...
  • 0
  • 0
@kidultff

PAT-B 真题- 1025. 反转链表 / A 1074 Reversing Linked List

原题干:给定一个常数K以及一个单链表L,请编写程序将L中每K个结点反转。例如:给定L为1→2→3→4→5→6,K为3,则输出应该为3→2→1→6→5→4;如果K为4,则输出应该为4→3→2→1→5→6,即最后不到K个元素不反转。输入格式:每个输入包含1个测试用例。每个测试 ...
  • 0
  • 0
@kidultff

PAT-B 真题- 1050. 螺旋矩阵

原题干:本题要求将给定的N个正整数按非递增的顺序,填入"螺旋矩阵"。所谓"螺旋矩阵",是指从左上角第1个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为m行n列,满足条件:m*n等于N;m>=n;且m-n取所有可能值中的最小值。输入格式:输入在 ...
  • 0
  • 0