自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

DevilsClaw

Just code it!

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

原创 Unity3D游戏制作 Day1-实现角色的移动

using UnityEngine;using System.Collections;public class Player : MonoBehaviour { //获得CharacterController组件 CharacterController characterController; //水平移动速度 public float walkSpeed =

2016-06-16 01:11:16 388

原创 CF2A Winner

简单的一道题。。。不停WA,还是改不了思维不缜密的坏习惯啊。。浪费好多时间,,说多都是泪。题目出处:http://codeforces.com/contest/2/problem/A#include using namespace std;map m;map m1;string name;int score;struct Player{ string name; int

2016-06-08 19:46:09 299

原创 CF1C Ancient Berland Circus

Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different.In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygo

2016-06-08 18:15:29 352

原创 CF1A Theatre Square

Codeforces上的第一题。。毫无疑问水的不行,立志从今天开始每天刷Codeforces走上红名之路。#include using namespace std;int main(){ long long n,m,a; long long row,col; cin>>n>>m>>a; if(n%a==0) col=n/a; else col=n

2016-06-08 13:46:03 234

原创 CF1B Spreadsheet

一道字符串相关的比较水的题目。。不过调试无数次后才AC,,,果然我思维还是不够缜密比较水。。#include using namespace std;int typeJudge(string s){ if (s[0] != 'R' || s[1] == 'C') return 2; bool foundR = false; bool foundC = false; for (in

2016-06-08 13:40:35 310 1

原创 CF677C Vanya and Label

其实这是一条Codeforces上的水题,但是想要做对也不容易……例如我就没想出方法,最后只好看题解才做出。这题要判断有多少种方法通过逻辑与“&”来获得输入的字符串,其中每个字符对应的数值如上面描述。由于字符的数值的范围为0~63,即2^6-1,那么每个字符可以转化为6位的二进制数,然后我们用一个循环来统计这个字符串所有字符转化为二进制后一共有多少位数为“0”即可,因为当一个位为“0”的时候,

2016-06-07 13:09:19 1617

原创 [Hackerrank] Floyd : City of Blinding Lights

之前一直没有关注Floyd算法,因为觉得它的时间复杂度很高不实用,但是见到这题才真正了解它的优点:能够获得多源最短路。大致的循环思路是:a) 初始化:D[u,v]=A[u,v]b) For k:=1 to nFor i:=1 to nFor j:=1 to nIf D[i,j]>D[i,k]+D[k,j] ThenD[i,j]:=D[i,k]+D[k,j];c) 算

2016-06-06 01:18:31 460

原创 [Hackerrank] The Coin Change Problem

继续学习DP算法,感觉一直不开窍啊。。。。这道题目很经典了,给出m个价值不同的硬币c1、c2……cm,要求找出能够凑出总价为n的方法,在维基上看到大概的思路如下:简单地理解,就是能够凑出价值i的情况只有两种,一种是不包括硬币cj,一种是包括硬币cj,我们只需要将两种情况相加即可直接代码:#include using namespace std;int coin[51];l

2016-06-05 01:24:15 743

原创 TSP问题动态规划解决

#include using namespace std;double dp[21][1100000];int n;struct City{ double x; double y;};City city[21];double dis[21][21];double getDis(City a, City b){ return sqrt((a.x - b.x

2016-05-09 12:27:34 1191

原创 CF670D2 Magic Powder

这题需要用到二分法,由于输入样例1#include using namespace std;int a[100010];int b[100010];int n, k, result;void search(long long left, long long right){ long long mid = (left + right) / 2; long long c

2016-05-07 00:49:00 263

原创 CF670C Cinema

这是Codeforces Round #350的一道题目,其实非常简单,但在比赛的时候被坑惨了,卡在这题上让我rating掉了80多。。。。原因是不懂得运用STL里面的map,单纯的遍历而导致超时哎。不过不管怎么样,也算学到了点知识,学会了与map相关的函数,并懂了用map建立hash表能够大大的节省时间。。。。。#include using namespace std;int a[20

2016-05-06 13:59:02 492

原创 CF629D Babaei and Birthday Cake

努力学习DP过程中,这题与最大递增子序列相似,不过如果用一般的DP方法算法复杂度为O(n^2),TEL。因此必须改用lower_bound使复杂度降为O(nlogn)便可AC。#include using namespace std;const double pi = 3.141592653589793;int n;vector cake;int indice[100010];i

2016-04-30 22:57:32 365

空空如也

空空如也

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

TA关注的人

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