今天没有新动态
@kidultff

提高编程效率的工具:C++ STL容器(总结篇)

1、vector头文件:vector创建:vector<ElementType> v追加:v.push_back()删除末尾元素:v.pop_back()迭代器:vector<ElementType>::iterator首元素迭代器:v.begin()尾元素迭代器:v.end()元素个数:v.size()清空:v.clear()2、set头 ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1008. Elevator

原题干:The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elev ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1007. Maximum Subsequence Sum

原题干:Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequenc ...
  • 0
  • 0
@kidultff

动态规划--最大连续子序列和

0x00、引言假设有这么一道题:给定一串序列A={-2, 11, -4, 13, -5, -2},要求求出 i 和 j ,使得Ai+......+Aj的和最大。这道题最直截了当的方法是暴力求解,从左端点到右端点依次遍历。但是这样时间复杂度会十分的高,这种问 ...
  • 0
  • 0
@kidultff

PAT-A 真题- 1006. Sign In and Sign Out

原题干:At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you are supposed to find ...
  • 0
  • 0