自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Beyond the Sora

拖延症晚期

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

原创 2017年山东省第八届acm省赛总结

作为一个即将退役的大三队员,这届省赛对我来说就是最后一次比赛了,同时也是最重要的一次比赛。在去年的省赛中,我们队发挥的不理想,没拿到奖牌,因此今年就是最后的机会,我们队在这一年中也准备了很多,其中也有过放弃,失望等时期,不过好在最后都坚持下来了。其中对我来说,最大的问题就是压力了,因为我是这个小队的队长,这一年中,我总是时不时回想起去年失败的情景,队友们失望的表情我现在都记忆犹新,每次这时我都怀疑

2017-05-09 10:50:34 1142

原创 FCN图像分割的mask标签使用transforms.ToTensor问题

最近在用pytorch写FCN时,将损失函数换成了CrossEntropyLoss,出现的问题是在第一个反向传播后,loss一下变成了0,之后再怎么训练loss都是0不再变化。而最初的loss看起来是一个正常的浮点数,很显然网络不可能经过一个epoch就找到了最优解。经过仔细排查后,发现经过dataloader出来的标签里面的值都为0,正常应该会包含一些[0,calss_num)的整数标签,原来是读取的mask文件经过transforms.ToTensor()方法之后都变成了0,该方法的源码中也写到be

2021-02-02 16:13:32 939 1

原创 CCF201909-2 小明种苹果(续)

好久没做题了,这么简单的题也WA了好几次,最后还是看网上的题解才弄明白问题:注意要有连续苹果的情况,这个时候不能重复计算,而且只有苹果树个数大于2的时候才需要统计E#include <iostream>#include <cstring>using namespace std;int a[2000],flag[2000];int main(){ int...

2019-12-09 15:05:23 269

原创 冬去春来

  今天湖南大学的拟录取名单出来了,我成功考上了湖南大学的硕士研究生,当初选择二战也算有了个满意的回报。正好趁着这个机会总结下这四(五)年的本科生活。  先说总结,烟台大学本科这四年可以说过的很充实,有许多欢乐的记忆,也有许多痛苦的回忆。现在回想起来,无论是人生的高潮还是低谷,都给予了我莫大的感触,让我在成功、轻松的时候冷静下来,不被喜悦冲昏了头脑,也让我顺利度过最失落的时期。  在家准备二战...

2019-04-04 23:51:52 701

原创 人工智能实现简单的五子棋程序

我这个程序在QQ五子棋上实验了一下,结果是黑棋先手全胜,白棋后手的胜率却惨不忍睹,原因有下: 1、五子棋的先手是有优势的,所以职业比赛里都会有禁手来实现公平 2、水平有限,对局面的评估只有一小部分主要思路就是博弈树,程序向前看一步,对对手可能的走法进行评估,评估的策略主要有两条: 1、扫描整个棋盘,判断出现了多少个三子成线并且两端未堵的情况,对方每出现一种该情况,评估大幅下降,因为这几乎...

2019-04-04 22:02:41 22385

原创 OpenGL应用——实现边缘填充算法

边缘填充的思想:枚举每一条边,对这条边右边的像素进行求补操作,就是有填充则去掉,无填充就进行填充#include <GL/gl.h>#include <GL/glut.h>#include <iostream>#include <cmath>#include <cstring>#include <string>using namespace std;int x[]= {10,70,70

2017-05-25 16:56:04 5150 2

原创 山东省第七届ACM省赛题——Fibonacci(二分)

Problem DescriptionFibonacci numbers are well-known as follow: Now given an integer N, please find out whether N can be represented as the sum of several Fibonacci numbers in such a way that the su

2017-05-04 15:36:38 773

原创 hdu1711——Number Sequence(KMP求位置)

Problem Description Given two sequences of numbers : a[1], a[2], …… , a[N], and b[1], b[2], …… , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K

2017-05-04 11:35:24 788

原创 poj3321——Apple Tree(树上树状数组)

DescriptionThere is an apple tree outside of kaka’s house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple tree.The tre

2017-05-03 20:53:40 1279

原创 poj1658——Eva's Problem

DescriptionEva的家庭作业里有很多数列填空练习。填空练习的要求是:已知数列的前四项,填出第五项。因为已经知道这些数列只可能是等差或等比数列,她决定写一个程序来完成这些练习。 Input第一行是数列的数目t(0 <= t <= 20)。以下每行均包含四个整数,表示数列的前四项。约定数列的前五项均为不大于10^5的自然数,等比数列的比值也是自然数。 Output对输入的每个数列,输出它的

2017-05-03 15:11:06 1477

原创 poj1664——放苹果(递推)

Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。 Output对输入的每组数据M和N,用一行输出相应的K。 Sample Input1 7 3 Sampl

2017-05-03 15:02:26 1655

原创 poj1552——Doubles

DescriptionAs part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list

2017-05-03 14:42:10 1961

原创 poj1163——The Triangle(简单dp)

Description7 3 8 8 1 0 2 7 4 4 4 5 2 6 5(Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at

2017-05-03 11:39:34 1080

原创 poj2528——Mayor's posters(离散化+区间覆盖)

DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has

2017-05-03 09:46:06 1149

原创 poj3308——Paratroopers(最小割)

DescriptionIt is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth are informed by their spies that the invaders of Mars wan

2017-05-02 20:03:14 2146

原创 csu1511——残缺的棋盘(bfs)

Input 输入包含不超过10000 组数据。每组数据包含6个整数r1, c1, r2, c2, r3, c3 (1<=r1, c1, r2, c2, r3, c3<=8). 三个格子A, B, C保证各不相同。Output 对于每组数据,输出测试点编号和最少步数。Sample Input 1 1 8 7 5 6 1 1 3 3 2 2 Sample Output Case 1: 7

2017-05-02 16:47:50 1525

原创 csu1803——2016(数学)

Description给出正整数 n 和 m,统计满足以下条件的正整数对 (a,b) 的数量: 1. 1≤a≤n,1≤b≤m; 2. a×b 是 2016 的倍数。 Input输入包含不超过 30 组数据。 每组数据包含两个整数 n,m (1≤n,m≤109). Output 对于每组数据,输出一个整数表示满足条件的数量。 Sample Input 32 63 20

2017-05-02 14:16:36 1371

原创 hdu5917——Wrestling Match(二分图染色)

Problem Description Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is “good player”, the rest is “bad player”. Now, Xiao Ming is refere

2017-05-02 11:22:44 1376

原创 hdu5242——Game(dfs贪心)

Problem Description It is well known that Keima Katsuragi is The Capturing God because of his exceptional skills and experience in ”capturing” virtual girls in gal games. He is able to play games sim

2017-04-29 17:58:38 1077 1

原创 poj3318——Matrix Multiplication(随机化算法)

DescriptionYou are given three n × n matrices A, B and C. Does the equation A × B = C hold true?InputThe first line of input contains a positive integer n (n ≤ 500) followed by the the three matrices A

2017-04-28 21:08:41 1305

原创 poj3177——Redundant Paths(双连通分量)

DescriptionIn order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1..F) to another field, Bessie and the rest of the herd are forced to cross near the Tree of Rotten App

2017-04-28 20:22:26 1119

原创 poj3352——Road Construction(双连通分量)

DescriptionIt’s almost summer time, and that means that it’s almost summer construction time! This year, the good people who are in charge of the roads on the tropical island paradise of Remote Island

2017-04-28 20:19:47 1029

原创 poj1364——King(差分约束)

DescriptionOnce, in one kingdom, there was a queen and that queen was expecting a baby. The queen prayed: “If my child was a son and if only he was a sound king.” After nine months her child was born,

2017-04-28 16:28:48 898

原创 poj2983——Is the Information Reliable?(差分约束+负权环路)

DescriptionThe galaxy war between the Empire Draco and the Commonwealth of Zibu broke out 3 years ago. Draco established a line of defense called Grot. Grot is a straight line with N defense stations.

2017-04-26 16:56:02 925

原创 poj1201——Intervals(差分约束)

DescriptionYou are given n closed, integer intervals [ai, bi] and n integers c1, …, cn. Write a program that: reads the number of intervals, their end points and integers c1, …, cn from the standar

2017-04-26 16:07:47 632

原创 poj3096——Surprising Strings(STL)

DescriptionThe D-pairs of a string of letters are the ordered pairs of letters that are distance D from each other. A string is D-unique if all of its D-pairs are different. A string is surprising if i

2017-04-25 10:58:00 929

原创 HZAU1208——Color Circle(dfs)

Description There are colorful flowers in the parterre in front of the door of college and form many beautiful patterns. Now, you want to find a circle consist of flowers with same color. What sh

2017-04-25 10:14:03 486

原创 csu1783——聊天止于呵呵(字符串)

Description (现代版)俗话说:流言止于智者,聊天止于呵呵。输入一段聊天记录,你的任务是数一数有多少段对话“止于呵呵”,即对话的最后一句话包含单词 hehe 或者它的变形。具体来说,我们首先提取出对话的最后一句话,把所有非字母的字符替换成空格,把所有字符 替换成小写,然后导出一个单词列表(由空格隔开),只要列表中的任何一个单词是 hehe,这 段对话就算作“止于呵呵”。比如,”Hi! A

2017-04-22 16:31:05 1101

原创 csu1779——错误的算法(模拟)

有道题目是这样的:输入一个 n 行 m 列网格,找一个格子,使得它所在的行和列中所有格子的数之和最大。如果答 案不唯一,输出任意解即可。比如,在下面的例子中,最优解是(1,3),即第一行和的三列的交 点(行从上到下编号为 1~n,列从左到右编号为 1~m),所有 7 个数之和为 35。 快要比赛的时候,有一个裁判想到了这样一个算法: 首先找一行 r(1<=r<=n) 使得该行所有数之和最大

2017-04-21 15:07:09 708

原创 OpenGL应用——实现中点Bresenham算法

算法本体还是照搬书上的,既然已经能搞DDA了,这个就很轻松了声明:以下知识全部来源于互联网,本人并不懂其中原理#include <GL/gl.h>#include <GL/glut.h>#include <iostream>#include <cmath>using namespace std;void init(){ glClearColor (0.0, 0.0, 0.0, 0

2017-04-21 14:35:43 2698

原创 OpenGL应用——实现DDA算法

计算机图形学上机实验终于能摸索画出来了,可喜可贺可喜可贺 DDA算法直接是参照教材上的,就是画点的那部分自己改了下,当然这就已经够累了,毕竟老师的意念教学默认你已经精通opengl,然后能立马画个钻石图案什么的。。。声明:以下知识全部来源于互联网,本人并不懂其中原理#include <GL/gl.h>#include <GL/glut.h>#include <iostream>#includ

2017-04-21 14:31:38 2521 1

原创 csu1781——阶乘除法

Description 输入两个正整数 n, m,输出 n!/m!,其中阶乘定义为 n!= 1*2*3*…*n (n>=1)。 比如,若 n=6, m=3,则 n!/m!=6!/3!=720/6=120。是不是很简单?现在让我们把问题反过来:输入 k=n!/m!,找到这样的整数二元组(n,m) (n>m>=1)。如果答案不唯一,n 应该尽量小。比如,若 k=120,输出应该是 n=5, m=1,而

2017-04-19 21:32:33 686

原创 csu1777——大还是小?(字符串处理?)

Description 输入两个实数,判断第一个数大,第二个数大还是一样大。每个数的格式为: [整数部分].[小数部分] 简单起见,整数部分和小数部分都保证非空,且整数部分不会有前导 0。不过,小数部分的最 后可以有 0,因此 0.0 和 0.000 是一样大的。 Input 输入包含不超过 20 组数据。每组数据包含一行,有两个实数(格式如前所述)。每个实数都 包含不超过 100 个字符

2017-04-19 20:43:07 561

原创 poj1088——滑雪(记忆化dp)

DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813

2017-04-19 14:56:14 789

原创 hdu4549——M斐波那契数列(费马小定理+矩阵快速幂)

Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下:F[0] = a F[1] = b F[n] = F[n-1] * F[n-2] ( n > 1 )现在给出a, b, n,你能求出F[n]的值吗?Input 输入包含多组测试数据; 每组数据占一行,包含3个整数a, b, n( 0 <= a, b, n <= 10^9 )Output 对每组测试

2017-04-18 21:27:30 831

原创 hdu4965——Fast Matrix Calculation(快速矩阵幂优化)

Problem Description One day, Alice and Bob felt bored again, Bob knows Alice is a girl who loves math and is just learning something about matrix, so he decided to make a crazy problem for her.Bob has

2017-04-18 14:07:42 697

原创 hdu5015——233 Matrix(矩阵快速幂)

Problem Description In our daily life we often use 233 to express our feelings. Actually, we may say 2333, 23333, or 233333 … in the same meaning. And here is the question: Suppose we have a matrix ca

2017-04-18 13:05:00 780

原创 Lightoj1112——Curious Robin Hood(线段树+单点更新)

Robin Hood likes to loot rich people since he helps the poor people with this money. Instead of keeping all the money together he does another trick. He keeps n sacks where he keeps this money. The sac

2017-04-13 21:33:01 684

原创 Lightoj1047——Neighbor House(dp)

The people of Mohammadpur have decided to paint each of their houses red, green, or blue. They’ve also decided that no two neighboring houses will be painted the same color. The neighbors of house i ar

2017-04-12 20:10:03 821

原创 Lightoj1111——Best Picnic Ever(dfs)

K people are having a picnic. They are initially in N cities, conveniently numbered from 1 to N. The roads between cities are connected by M one-way roads (no road connects a city to itself).Now they w

2017-04-12 19:24:02 640

空空如也

空空如也

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

TA关注的人

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