自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dai

  • 博客(21)
  • 收藏
  • 关注

原创 1030. Travel Plan (30)

#include#includeconst int INF = 1e6;using namespace std;const int maxn = 5e2 + 10;int md[maxn][maxn], mc[maxn][maxn];int vis[maxn], dis[maxn], path[maxn], c[maxn];int n, m, s, d, c1, c2, dist,

2018-01-29 21:44:46 265

原创 1029. Median (25)

#include#include#includeusing namespace std;vectora;int n, m;long int x;int main(){ cin >> n; while (n--)cin >> x, a.push_back(x); cin >> m; while (m--)cin >> x, a.push_back(x); nth_eleme

2018-01-29 17:13:23 94

原创 1025. PAT Ranking (25)

#include#include#include#includeusing namespace std;const int maxn = 110;const int maxk = 310;int n, k;struct point { string rn; int score; int local_number; int local_rank; int final_ran

2018-01-28 16:02:32 91

转载 1016. Phone Bills (25)

#include#include#include#include#define daytime 24using namespace std;struct PhoneBills { char id[21]; bool on; int month; int dd, hh, mm;};void reaDln(PhoneBills * PB, int N)//这个真的厉害,oNof

2018-01-07 21:36:14 114

原创 1015. Reversible Primes (20)

#include#include#includeusing namespace std;bool isPrime(int N){ if (N < 2)return false; if (N == 2 || N == 3)return true; for (int i =sqrt(N); i >=2; i--) if (N%i == 0)return false; return

2018-01-06 23:05:33 118

原创 1014. Waiting in Line (30)

果然最重要的还是读懂题目,,这个是动态的排队过程,黄线外面的人看那个队少了一个人就插进去,一开始想简单了,以为是大家都全部排好再开始,这个题目是黄线以内的排好后就开始,后面的人动态的插进去#includeusing namespace std;const int MaxN = 10001;int N, M, K, Q;int protime[MaxN]; typedef stru

2018-01-06 21:28:15 141

转载 1013. Battle Over Cities (25)

#include#includeusing namespace std;const int MaxE = 1001;int edge[MaxE][MaxE];int visited[MaxE];int N, M, K;void dfs(int i){ visited[i] = 1; for (int j = 1; j <= N; j++) { if (!visited[j

2018-01-06 18:12:28 97

原创 1012. The Best Rank (25)

#include#include#include#includeusing namespace std;struct stu { int ID; int C; int M; int E; int A; int bestRank; char bestItem; stu(int id, int c, int m, int e) :ID(id), C(c), M(m), E(e

2018-01-06 15:26:57 144

原创 1011. World Cup Betting (20)

#includeusing namespace std;#includeint findmax(double team[]){ double max=0.0; int num; for (int i = 0; i < 3; i++) { if (team[i] > max) { max = team[i]; num = i; } } return num

2018-01-05 09:27:47 103

原创 1010. Radix (25)

#include#includeusing namespace std;long long Cal(char a){ if (a >= '0'&&a <= '9') return a - '0'; else return a - 'a' + 10;}long long NUM(char N[], long long radix){ long long sum = 0;

2018-01-05 08:34:53 159

原创 1009. Product of Polynomials (25)

#include#includeusing namespace std;typedef struct Node * List;struct Node { int expon; double coef; List Next;};void Attach(int expon, double coef, List * Rear){ List tmp = new struct Node

2018-01-04 21:29:58 94

原创 1008. Elevator (20)

#includeusing namespace std;const int uptime = 6;const int downtime = 4;const int staytime = 5;int main(){ int sumtime = 0; int N; cin >> N; int floor; cin >> floor; N = N - 1; sumtime +

2018-01-04 19:00:45 81

原创 1007. Maximum Subsequence Sum (25)

#includeusing namespace std;int a[10000];int main(){ int N; cin >> N; for (int i = 0; i < N; i++) cin >> a[i]; int thislist = 0, maxlist = 0; int i; int front = 0, rear = 0, mf = 0, mr =

2018-01-04 15:38:13 109

原创 1006. Sign In and Sign Out (25)

#include#includeusing namespace std;int main(){ int N; char IDin[16], IDout[16], In[9] = "23:59:59", Out[9] = "00:00:00"; char ID_number[16], Signintime[9], Signouttime[9]; cin >> N; while (

2018-01-03 21:57:16 140

原创 1005. Spell It Right (20)

终于碰到会做的了,,,这个真的简单#include#includeusing namespace std;void Print(char a){ char num[10]; switch (a) { case '0': cout << "zero"; break; case '1': cout << "one"; break; case '2'

2018-01-03 20:31:02 94

原创 1004. Counting Leaves (30)

#includeusing namespace std;#include#includemap>adjlist; //每一个int对应一个数组索引int levelleaves[101];void dfs(int node, int level){ if (adjlist[node].empty()) //node那一行是不是空的,是空的,说明这层有叶节点,就加一 { lev

2018-01-03 20:02:26 89

原创 1003. Emergency (25)

#includeusing namespace std;const int INF = 1000000;const int MaxN=501;int N, M, S, T;int team[MaxN];int map[MaxN][MaxN];int path[MaxN];int amount[MaxN];int collected[MaxN];int dist[MaxN];

2018-01-03 17:39:11 117

原创 1002. A+B for Polynomials (25)

#include#includeusing namespace std;typedef struct Node * List;struct Node { int expon; double coef; List Next;};void Attach(int expon, double coef, List * Rear){ List tmp = new struct Node

2018-01-02 15:31:02 101

原创 1001. A+B Format (20)

#include#includeusing namespace std;int main(){ int a, b; cin >> a; cin.get(); cin >> b; cin.get(); int sum = a + b; if (sum < 0) { cout << "-"; sum = -sum; } if (sum < 1

2018-01-02 14:41:58 109

原创 7-4 是否同一棵二叉搜索树

#include&lt;iostream&gt;using namespace std;typedef struct Node * Tree;struct Node { int Data; Tree Left, Right; int flag;};Tree NewNode(int tmp){ Tree T = new struct Node; T-&gt;Data = tm...

2018-01-01 22:50:13 567

原创 7-3 树的同构(25 分)

#include&lt;iostream&gt;using namespace std;const int Maxsize = 20;struct Node { char Data; int Left, Right;}T1[Maxsize], T2[Maxsize];typedef struct Node Tree;int check[Maxsize];void Initial...

2018-01-01 18:07:51 1053

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除