自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

转载 cf589div2

https://codeforces.com/contest/1228/problem/A#include<iostream>#include<cstdio> using namespace std; int pd(int x) { int a[10] = {}; while(x) { if(a[x%10]) return...

2019-10-01 02:46:00 120

转载 comet#10 C

//枚举 2n 的质因子a ,2n/a = b, ap - bq = 1, 找到 bq(min)#include<bits/stdc++.h>const int MA = 1e6+100;typedef long long ll;int t, vis[MA],pri[MA],prinum,cnt;ll n,fac[50];using name...

2019-09-10 23:00:00 104

转载 cf573div2

//cf573div2d//题意输入n a1-an堆石头, sjf先手 每次只能拿走一块石头(任意堆) ,//当轮到谁 所有堆石头都为0 或 有两堆石头数相同时( 0 0)即输#include<bits/stdc++.h>using namespace std;const int MA = 1e5+100;int a[MA], n;int ma...

2019-09-02 14:22:00 112

转载 Codeforces Round #569 (Div. 2)

https://codeforces.com/contest/1180A. Alex and a Rhombus找规律,不难发现 a[i] = a[i-1]+4*(i-1)或者 a[n] = 2*n*n-2*n+1#include<bits/stdc++.h>using namespace std;int main(){ ...

2019-06-27 00:28:00 110

转载 poj2299 离散化 树状数组求逆序对

#include<algorithm>#include<iostream>#include<cstring>#include<cstdio>//poj 2299 题意 输入一个数组,输出冒泡排序 (升序)需要的交换次数//题解 离散化 树状数组求逆序对//离散化 将输入数字变成他们大小的顺序 例如: 9 1...

2019-04-25 23:55:00 106

转载 uva11729 水题

或许每个人都有成为将军的梦想,小光也是如此。从小,小光就立志长大了以后要做一名军人,保家卫国。有一天,他做了一个梦,在梦里,他是一个英明神武的将军,但是敌国马上就要入侵了,作为将军的他责无旁贷需要挺身而出,于是他开始做一些战略部署。假设当前小光有n个部下,每个部下需要完成一项任务。第i个部下需要小光花Bi分钟交代任务,然后他会立刻独立地、无间断地执行Ji分钟后完成任务。小光需要选择交代任...

2019-04-16 22:46:00 109

转载 gdb 调试C++代码

紫薯上的 使用 gdb 调试程序 , 试了下 , 确实可以很好加深对 递归 和程序执行的理解程序如下:#include<cstdio>int f(int n){ return n==0 ? 1:f(n-1)*n;}int main(){ printf("%d\n", f(5)); return 0;}...

2019-04-08 21:33:00 198

转载 uva1339 Ancient Cipher 读懂题便会做

#include<algorithm>#include<iostream>#include<cstdio>#include<string>#include<cstring>//uva1339 输入两个字符串 问第二个重排序与替换能否得到第一个using namespace std;//两个字符串出...

2019-04-08 13:09:00 71

转载 区间相关问题

此类问题区间有左右两个端点 , 非常适合用 pair 容器,选择不相关区间选择最多不相关区间数 , 按右端点排序 相同在按左端点排序(从小到大),选择第一个区间后,排除相关区间, 再重复选符合的第一个,直到不能选择例 http://nyoj.top/problem/14#include<iostream>//http://nyoj.top...

2019-03-20 14:04:00 206

转载 UVA: Beginning Algorithm Contests (Rujia Liu) :: Volume 0. Getting Started

ACM Getting Started 熟悉刷题的基本输入输出操作和 刷水题的蒻鲫故事 吃了没文化的亏 简单题看题意半天 实在不行看中英文对照了 就只看输入输出猜猜题意 菜啊494 - Kindergarten Counting GameEverybody sit down in a circle. Ok. Listen to me careful...

2018-10-21 21:13:00 94

转载 uva368 水题 关于memset初始化的位置

#include<algorithm>#include <iostream>#include <sstream>#include <cstdlib>#include <cstring>#include <cstdio>#include <vector>#include <ctim...

2018-10-21 16:04:00 91

转载 算法竞赛入门经典第二版 第二章习题及思考题

enmmmmmm】 大部分好像除了最后一个思考题都很简单代码如下#include <iostream>#include <cstring>#include <cstdio>#include <cmath>int main(){ /* for(int i =100 ; i &l...

2018-10-10 22:49:00 171

转载 关于C语言中 全局变量与局部变量的初始化

首先上两段代码#include<bits/stdc++.h>//WAusing namespace std;int main(){ int X,Y,n,m,cnt;char s[1005];//若X Y cnt不为全局变量 值不初始化为0 scanf("%d%d",&n,&m); for (int i=1;i&...

2018-10-09 08:48:00 541

转载 hdu1576 逆元板子题

A/BTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6867Accepted Submission(s): 5457Problem Description要求(A/B)%9973,但由于A很大,我们只给出...

2018-10-09 00:04:00 64

转载 初学 博弈论 又称对策论 Game Theory

博弈论 真的很有趣 ,回想起 前两天多校一道题的题解 所有不公平的游戏都存在必胜的玩法与人斗其乐无穷https://vjudge.net/contest/241983#overview 博弈论专题一)巴什博奕(Bash Game):有n个石头,Alice和Bob轮流取石头,每次取的石头不能超过m个,Alice开始取,最后取完的赢,两个人都是以最优的方案取,求最终赢的是谁...

2018-08-07 15:35:00 258

转载 hdu多校第二场dls题解 dls的搬运工

A题Absolute#include <bits/stdc++.h>using namespace std;#define rep(i,a,n) for (int i=a;i<n;i++)#define per(i,a,n) for (int i=n-1;i>=a;i--)#define pb push_back#define...

2018-07-25 23:42:00 192

转载 2018 Multi-University Training Contest 1 hdu搬运工

2018-07-26 00:26:29http://acm.hdu.edu.cn/contests/contest_show.php?cid=802被三整除一定是三个数相等,其次是被2整除且被四整除的数可取s=2x1;s=4x2;s=x1+2x2A题// A#include <bits/stdc++.h>using namesp...

2018-07-23 20:47:00 228

转载 大白书4-4.1

4.4.1 xiao小问题集锦 solve() 和 f() g() h()#include <iostream>#include <cassert> //算法竞赛入门经典4-4#include <cstdio>#include <ctime>//#include <size>typedef l...

2018-07-09 15:12:00 77

转载 Codeforces Round #479 (Div. 3)

977A - Wrong Subtractionhttp://codeforces.com/contest/977/problem/A简单题 题意如果尾数为0 除10 否则-1for (int i = 0; i < k; ++i) { if (n % 10 == 0) n /= 10; else n--;}977B - Two-gram ...

2018-06-05 23:10:00 75

转载 hdu2015 水题

/*水题 但是这个PE让我真的很气 最后一项不能有空格*/#include <stdio.h>// 我写的略复杂 #include <string.h>//hdu 2015 Presentation Errorint main(){ int a[105],n,c,m,b,i,j,s,f,sum; while(sca...

2018-01-24 23:56:00 133

转载 hdu2629 水题

/*hdu2629 题意 输入一个18位的身份证号码 前六位是地区 再八位是出生年月日 后四位特殊标号前六位地区 在题目中有八个地区 ,输出He/She is from “地区”,and his/her birthday is on 月,日,年 based on the table.if语句就好 问题就是输入 我用了scanf的控制输入语句 但是WA料想是输入字符串 而...

2018-01-24 21:21:00 129

转载 hdu 1197 水题 但是英文题目真的很艰难 忍不住还是用了翻译

//题目的难度是读题233333 题意:输出所有四位数 满足十进制各位数字之和等于十二进制 等于十六进制的 顺便换个行//这是我写的 很丑 对吧#include <stdio.h>int main(){ int n,a1,a2,a3,a4,b1,b2,b3,b4,c1,c2,c3,c4; for(int i=1000;i<=9999;i++) { ...

2018-01-17 15:07:00 78

转载 递归的题解 https://vjudge.net/contest/154741

A - 母牛的故事 #include<iostream>using namespace std;long long a[100];int main(){ int n; while(cin>>n) { a[1]=1;a[2]=2;a[3]=3;a[4]=4; if(n==0) break...

2017-03-28 17:10:00 215

转载 喵喵呵呵村的 魔法术 http://qscoj.cn/problem/16/

#include<iostream>//线段树#include<cstring>#include<cstdio>#include<cmath>#include<algorithm>using namespace std;const int mod=4e5+9;long long i...

2017-03-28 17:07:00 109

空空如也

空空如也

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

TA关注的人

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