UVA
PeterBishop0
一起进步!
展开
-
10474 Where is the Marble?(sort)
#include<cstdio>//这题看懂题目就好了 #include<algorithm> using namespace std; const int maxn = 10000; int main() { int n, q, x, a[maxn], kcase = 0; while (scanf("%d%d", &n, &q) == 2 &...原创 2018-07-11 10:55:17 · 192 阅读 · 0 评论 -
101 The Blocks Problem (vector二维)
#include <iostream> #include <cstdio> #include <vector> #include <string> using namespace std; int n; vector<int>pile[30];//重点在于记录实时位置,vector这种可以动态申请的数组正好可以当作二维数组用。第一维堆第二...原创 2018-07-11 10:59:46 · 293 阅读 · 0 评论 -
10815 Andy's First Dictionary (set stringstream输出单词)
#include<iostream> #include<string> #include<set> #include<sstream> using namespace std; set<string> dict;//set存储单词 int main(){ string s,buf; ...原创 2018-07-11 11:04:41 · 290 阅读 · 0 评论 -
156 Ananagrams(vector记录单词,map记录次数 排序标准化单词)
#include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #include <map> #include <vector> using namespace std; map&原创 2018-07-11 11:14:10 · 268 阅读 · 0 评论 -
540 Team Queue (queue模拟队伍数据记录操作)
#include<iostream> #include<queue> #include<map> #include<string> //类似于二维数组,但是需要模仿queue必须要两个queue using namespace std; const int maxt= 1010; int main() { int t, kcase = 0; wh...原创 2018-07-11 11:18:02 · 190 阅读 · 0 评论 -
136 Ugly Numbers (priority_queue模拟 拓展)
#include <iostream> #include <set> #include <queue> #define LL long long using namespace std; //丑数都可以用1*x 2*x 3*x 5*x表示,要做的就是用priority_queue来入队自动优先值排序再出队(就是优先值最小的),对最小的重复操作 //这里的gr...原创 2018-07-11 11:26:53 · 266 阅读 · 0 评论 -
11624 Fire(两次bfs)
#include<bits/stdc++.h>// //记录火烧的时间(step)和人的比较就好了 typedef long long ll; using namespace std; const int MAXN = 1010; int n,m; char G[MAXN][MAXN]; int fire[MAXN][MAXN]; //火烧到(i,j)的最小时间 i...原创 2018-07-27 14:41:27 · 325 阅读 · 0 评论