- 博客(33)
- 资源 (16)
- 问答 (2)
- 收藏
- 关注
原创 2019 年百度之星·程序设计大赛 - 初赛三 1001 最短路 1(思维)
Problem Description有一张 n 个点的完全无向图,点的标号是 1...n,其中边 (i,j)(i,j)(i,j) 的长度是 ixorj,现在你需要求出点 1 到点 n 的最短路的长度。Input第一行一个正整数 T 表示数据组数 1≤T≤100对于每组数据:第一行一个正整数 nnn 表示点数 (2≤n≤105)Output输出 T 行,每行一个整数表示...
2019-08-24 17:24:35 282
原创 2019中国大学生程序设计竞赛(CCPC) - 网络选拔赛 解题报告
1001 ^&^Problem DescriptionBit operation is a common computing method in computer science ,Now we have two positive integers A and B ,Please find a positive integer C that minimize the value o...
2019-08-23 18:23:39 17458 29
原创 2019 年百度之星·程序设计大赛 - 初赛二 解题报告
题目链接1001 度度熊与数字(签到题)Accepts: 3638Submissions: 7683Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description度熊发现,1, 3 以及 9 这三个数字很神奇,它们的所有的倍数的每位数字的...
2019-08-19 10:37:17 642
原创 2019 年百度之星·程序设计大赛 - 初赛一 解题报告
题目链接1001 Polynomial (基础数学)Accepts: 2234Submissions: 5283Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description度度熊最近学习了多项式和极限的概念。 现在他有两个多项式 f(x...
2019-08-18 09:54:02 3322 6
原创 2017中国大学生程序设计竞赛-杭州站 : Master of GCD(差分)
题意分析:初始数组中的数都为1,每次选一个区间[l, r], 使该区间中的数乘2或3, 最后求所有数的最大公约数。解题思路:因为2和3最大公约数为1, 所以如果要求所有数的最大公约数,那么就是所有数都乘的一个数,也就是说,如果他们的最大公约数是2,那么所有的数都一定乘过2.记录所有数乘2和乘3的最小次数,答案为pow(2, min2)* pow(3, min3)% ...
2019-08-17 15:07:35 155
原创 2017中国大学生程序设计竞赛-杭州站 Problem C. Hakase and Nano(博弈)
题意分析:有n堆石子,每次可以取一对石子的一颗或多颗,取得最后一颗石子的人获胜,Hakase每回合可以取两次,Nano每回合可以取一次,给出Hakase先手或后手,求Hakase会不会获胜。解题思路:因为Hakase每回合可以取两次,大部分情况下可以获胜,所以应该考虑Hakase失败的情况,当先手时,如果堆数是3的倍数,且全为1,那么他必败,因为每次H必须取两堆,对方取一堆,最...
2019-08-17 14:59:03 346
原创 2017中国大学生程序设计竞赛-杭州站 Problem A. Super-palindrome(贪心)
题意分析:改变最少的字符,使字符串的每一个长度为奇数的子串都为回文串解题思路:如果想让任意奇数的子串为回文串,必须要让奇数位和偶数位上的所有字符相等,所以统计一下奇数位和偶数位上最多的字符,剩下的是要改变的。#include <stdio.h>#include <string.h>#include <algorithm>#defi...
2019-08-17 14:53:40 2289
原创 CodeForces - 1020B:Badge (模拟找环)
题目链接In Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of n students doing yet another trick.Let's assume...
2019-08-16 11:50:30 314
原创 hdu 1272 :小希的迷宫(并查集)
http://acm.hdu.edu.cn/showproblem.php?pid=1272Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从...
2019-08-16 10:28:30 399
原创 hdu 5971 :Wrestling Match(DFS染色)
http://acm.hdu.edu.cn/showproblem.php?pid=5971Problem DescriptionNowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”, t...
2019-08-16 09:16:28 164
原创 hdu 2680:Choose the best route(Dijkstra , SPFA)
http://acm.hdu.edu.cn/showproblem.php?pid=2680Problem DescriptionOne day , Kiki wants to visit one of her friends. As she is liable to carsickness , she wants to arrive at her friend’s home as soo...
2019-08-15 11:37:10 131
原创 Gym - 102219E : Optimal Slots(01背包)
http://codeforces.com/gym/102219/problem/EThe main hall of your residency is open for use by the local community and public. Since it was built on public donations, there is no charge of using it. E...
2019-08-15 09:59:02 293
原创 Gym - 102219K :Help The Support Lady(贪心)
http://codeforces.com/gym/102219/problem/KNina works as an IT support in a software company and always busy. The biggest issue she is facing is that sometimes she misses some deadlines. In their tea...
2019-08-15 09:42:29 1119
原创 Gym - 102219J : Kitchen Plates(拓扑排序)
http://codeforces.com/gym/102219/problem/JYou are given 5 different sizes of kitchen plates. Each plate is marked with a letter A, B, C, D, or E. You are given 5 statements comparing two different p...
2019-08-15 09:17:04 358
原创 Gym - 102219A:Mental Rotation(模拟)
http://codeforces.com/gym/102219/problem/AMental rotation is a difficult thing to master. Mental rotation is the ability to imagine in your mind how an object would look like from a viewer's side if...
2019-08-15 09:09:49 426
原创 POJ 1751:Highways(最小生成树)
http://poj.org/problem?id=1751DescriptionThe island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian government is aware of th...
2019-08-14 12:03:15 175
原创 Gym - 102058L :Repetitive Palindrome (回文串判断)
https://vjudge.net/problem/Gym-102058LYou are given a string s consisting of lowercase alphabets, and an integer k.Make a new string tby concatenating k copies of s. Determine whether t is a pal...
2019-08-14 10:15:28 176
原创 Gym - 102058M :Coke Challenge(模拟)
https://vjudge.net/problem/Gym-102058MMr. Jeong really loves coke. He loves so much that he drinks coke everyday without exception. One day, he decided to open a coke contest in Daejeon. To the winn...
2019-08-14 09:53:50 409
原创 ZOJ 1586:QS Network(Prim)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1586Sunny Cup 2003 - Preliminary RoundApril 20th, 12:00 - 17:00Problem E: QS NetworkIn the planet w-503 of galaxy cgb, there is a ...
2019-08-14 09:08:03 168
原创 FZU Problem 2150: Fire Game (BFS)
http://acm.fzu.edu.cn/problem.php?pid=2150Problem DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board (N rows, M columns). At the beginning, each grid of th...
2019-08-14 09:00:40 154
原创 LightOJ 1245: Harmonic Number (II) (数学)
http://lightoj.com/volume_showproblem.php?problem=1245I was trying to solve problem '1234 - Harmonic Number', I wrote the following codelonglongH(intn){ longlongres=0; for(inti...
2019-08-14 08:35:19 191
原创 LightOJ:1234 - Harmonic Number (调和级数求和)
http://lightoj.com/volume_showproblem.php?problem=1234In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers:In this problem, you are given n, you h...
2019-08-13 10:35:26 210
原创 洛谷 P2053 :[SCOI2007]修车(拆点+最小费用流)
https://www.luogu.org/problem/P2053题目描述同一时刻有N位车主带着他们的爱车来到了汽车维修中心。维修中心共有M位技术人员,不同的技术人员对不同的车进行维修所用的时间是不同的。现在需要安排这M位技术人员所维修的车及顺序,使得顾客平均等待的时间最小。说明:顾客的等待时间是指从他把车送至维修中心到维修完毕所用的时间。输入格式第一行有两个数M,N,表示...
2019-08-12 11:03:27 245
原创 LightOJ - 1041:Road Construction (最短路+字符串处理)
https://vjudge.net/problem/LightOJ-1041There are several cities in the country, and some of them are connected by bidirectional roads. Unfortunately, some of the roads are damaged and cannot be used...
2019-08-11 09:23:41 229
原创 LightOJ - 1040:Donation(Prim)
https://vjudge.net/problem/LightOJ-1040A local charity is trying to gather donations of Ethernet cable. You realize that you probably have a lot of extra cable in your house, and make the decision t...
2019-08-11 09:23:37 216
原创 LightOJ - 1029:Civil and Evil Engineer(最小生成树+最大生成树)
https://vjudge.net/problem/LightOJ-1029A Civil Engineer is given a task to connect n houses with the main electric power station directly or indirectly. The Govt has given him permission to connect ...
2019-08-11 09:23:29 299
原创 POJ2135 :Farm Tour(最小费用流)
http://poj.org/problem?id=2135DescriptionWhen FJ's friends visit him on the farm, he likes to show them around. His farm comprises N (1 <= N <= 1000) fields numbered 1..N, the first of which...
2019-08-09 11:13:05 227
原创 POJ 2479:Maximum sum(贪心)
http://poj.org/problem?id=2479DescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:Your task is to calculate d(A).InputThe input consists of T(<=...
2019-08-08 09:28:23 389
原创 UVA - 10591 :Happy Number (打表)
https://vjudge.net/problem/UVA-10591题意分析:把一个数各位数的平方相加,如果不是1,继续操作,如果是1,那么这个数是一个Happy number,如果怎么变都不能变成1,就不是一个Happy number。解题思路:既然是各位数的平方相加,那么最大的数几个一轮操作后一定不会超过1000,那么我只要知道1000以内的Happy n...
2019-08-07 09:04:21 111
原创 LightOJ - 1122 :Digit Count (DFS)
https://vjudge.net/contest/317762#problem/LGiven a set of digits S, and an integer n, you have to find how many n-digit integers are there, which contain digits that belong to S and the difference b...
2019-08-07 08:50:25 140
原创 hdu 2102:A计划(BFS)
http://acm.hdu.edu.cn/showproblem.php?pid=2102Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定...
2019-08-06 11:22:16 144
原创 hdu 5926:Mr. Frog’s Game
http://acm.hdu.edu.cn/showproblem.php?pid=5926Problem DescriptionOne day, Mr. Frog is playing Link Game (Lian Lian Kan in Chinese).In this game, if you can draw at most three horizontal or vertic...
2019-08-06 09:05:49 125
原创 hdu 5922:Minimum’s Revenge(贪心)
http://acm.hdu.edu.cn/showproblem.php?pid=5922Problem DescriptionThere is a graph of n vertices which are indexed from 1 to n. For any pair of different vertices, the weight of the edge between th...
2019-08-06 08:47:59 161
C语言魔塔游戏十层.zip
2020-03-31
RentingSystem.rar
2020-01-10
不用jQuery怎么给一类元素添加点击事件
2022-07-07
html中from表单onclick和onsubmit方法的区别
2022-07-07
TA创建的收藏夹 TA关注的收藏夹
TA关注的人