![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
wuligiaogiao
这个作者很懒,什么都没留下…
展开
-
PAT 1060 Are They Equal?
#include<iostream> #include<string> using namespace std; int n; string deal(string s, int&e) { int k = 0; while (s.length() > 0 && s[0] == '0') { s.erase(s.begi原创 2019-01-25 18:12:50 · 124 阅读 · 0 评论 -
PAT A1032 Sharing (25 point(s))
我发现字母根本不用管它,所以结构体只写入了地址 #include<iostream> using namespace std; const int maxn = 100010; struct NODE { int next; bool flag; char data; NODE():flag(false){} }node[maxn]; int main() { int ...原创 2019-01-27 17:27:00 · 147 阅读 · 0 评论 -
PAT A1052 Linked List Sorting
坑 有全部无效数据 输出‘0 -1’ 所有的地址都是5位 “%05d” #include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int maxn = 100010; struct NODE { int key; int next, adre...原创 2019-01-27 18:38:01 · 82 阅读 · 0 评论 -
PAT A 1051 Pop Sequence
每次栈用完记得清空! #include<iostream> #include<stack> #include<algorithm> using namespace std; const int maxn = 1010; int main() { stack<int> s; int m, n, k; cin >> m >&...原创 2019-01-28 13:04:51 · 108 阅读 · 0 评论 -
1046 Shortest Distance
第三个测试点怎么都过不了,后来把maxn从10010改成1000010就过了 #include<iostream> #include<algorithm> using namespace std; const int maxn = 1000010; int a[maxn], c[maxn] = { 0 }; int main() { int n,m, sum = 0...原创 2019-01-28 19:00:45 · 106 阅读 · 0 评论 -
PAT A1006 Sign In and Sign Out
用scanf"%d:%d:%d"里的冒号把时间转换成整数直接比较大小 #include <iostream> #include <string> #include<algorithm> using namespace std; struct f{ string ID; int time1, time2; }mem[10010]; bool cmp1(f ...原创 2019-01-29 14:37:31 · 172 阅读 · 0 评论 -
PAT #A1051 Pop Sequence
#include<iostream> #include<queue> #include<algorithm> using namespace std; const int maxn=1010; struct mouse { int weight, order, rank; }mouse[1010]; queue<int> q; int m...原创 2019-02-22 21:35:59 · 136 阅读 · 0 评论