L1-029. 是不是太胖了

摘要: 据说一个人的标准体重应该是其身高(单位:厘米)减去100、再乘以0.9所得到的公斤数。已知市斤是公斤的两倍。现给定某人身高,请你计算其标准体重应该是多少?(顺便也悄悄给自己算一下吧……) 输入格式: 输入第一行给出一个正整数H(100 < H <= 300),为某人身高。 输出格式: 在一行中输出对 阅读全文
posted @ 2017-03-09 12:31 猪是的念来过倒 阅读(227) 评论(0) 推荐(0) 编辑

L1-028. 判断素数

摘要: 本题的目标很简单,就是判断一个给定的正整数是否素数。 输入格式: 输入在第一行给出一个正整数N(<=10),随后N行,每行给出一个小于231的需要判断的正整数。 输出格式: 对每个需要判断的正整数,如果它是素数,则在一行中输出“Yes”,否则输出“No”。 输入样例: 输出样例: 直接判断一下 大于 阅读全文
posted @ 2017-03-09 12:26 猪是的念来过倒 阅读(173) 评论(0) 推荐(0) 编辑

L1-027. 出租

摘要: 下面是新浪微博上曾经很火的一张图: 一时间网上一片求救声,急问这个怎么破。其实这段代码很简单,index数组就是arr数组的下标,index[0]=2 对应 arr[2]=1,index[1]=0 对应 arr[0]=8,index[2]=3 对应 arr[3]=0,以此类推…… 很容易得到电话号码 阅读全文
posted @ 2017-03-09 12:15 猪是的念来过倒 阅读(205) 评论(0) 推荐(0) 编辑

DP HDU1421

摘要: 搬寝室 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26726 Accepted Submission(s): 9218 Problem De 阅读全文
posted @ 2017-01-07 14:53 猪是的念来过倒 阅读(74) 评论(0) 推荐(0) 编辑

并查集

摘要: n个人 m个关系 p次查询 simple input 9 7 6 2 4 5 7 1 3 8 9 1 2 5 6 2 3 1 2 1 3 1 4 1 5 5 6 8 9 simput output YES YES YES NO YES YES 阅读全文
posted @ 2017-01-07 14:31 猪是的念来过倒 阅读(98) 评论(0) 推荐(0) 编辑

约瑟夫环

摘要: 描述 有n个人,坐成一个圈,每个人的编号是0,1,2,3,4,5,6,7,8,9,......n; 从0开始报数,每次报道第m个人的时候,这个人出局,并且从下一个人开始重新报数,知道这个圈只剩下两个人。 input 给一个n,m, output 求出最后一个人的编号是多少 simple input 阅读全文
posted @ 2016-12-28 14:32 猪是的念来过倒 阅读(91) 评论(0) 推荐(0) 编辑

Codeforces554B:Ohana Cleans Up

摘要: B. Ohana Cleans Up Time Limit: 2000ms Memory Limit: 262144KB 64-bit integer IO format: %I64d Java class name: (Any) Time Limit: 2000ms Memory Limit: 2 阅读全文
posted @ 2016-07-12 15:37 猪是的念来过倒 阅读(156) 评论(0) 推荐(0) 编辑

Codeforces554A:Kyoya and Photobooks

摘要: A. Kyoya and Photobooks Time Limit: 2000ms Memory Limit: 262144KB 64-bit integer IO format: %I64d Java class name: (Any) Time Limit: 2000ms Memory Lim 阅读全文
posted @ 2016-07-12 15:03 猪是的念来过倒 阅读(109) 评论(0) 推荐(0) 编辑

Codeforces554 C Kyoya and Colored Balls

摘要: C. Kyoya and Colored Balls Time Limit: 2000ms Memory Limit: 262144KB 64-bit integer IO format: %I64d Java class name: (Any) Time Limit: 2000ms Memory 阅读全文
posted @ 2016-07-12 14:56 猪是的念来过倒 阅读(404) 评论(0) 推荐(0) 编辑

CPP - sort

摘要: #include "stdafx.h" #include #include using namespace std; class student{ public: student(){} student(int num, string str, int s) {id= num;name = str;score = s; } student(student &stu){id = stu.... 阅读全文
posted @ 2016-06-06 20:04 猪是的念来过倒 阅读(378) 评论(0) 推荐(0) 编辑