模拟
文章平均质量分 81
做不完的ACM
加油,努力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces Round #450 (Div. 2)B
题意:给出a,b,c 问a/b小数点第几位第一出现c,不出现输出-1题解:直接模拟除法即可。#include using namespace std;const int N = 1E5 + 7;int h[N*10];int main(){ int a, b, c, i = 1; scanf("%d%d%d",&a,&b,&c); a = a - b*原创 2017-12-13 22:15:03 · 220 阅读 · 0 评论 -
ZOJ 3983简单模拟
#include <bits/stdc++.h>using namespace std;int main(){ ios::sync_with_stdio(false), cin.tie(0); int T; cin >> T; while(T --) { string s, t; cin >&...原创 2018-05-08 12:31:26 · 319 阅读 · 0 评论 -
ZOJ3993 半径比较/圆的相交面积
Safest BuildingsTime Limit: 1 Second Memory Limit: 65536 KBPUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for ...原创 2018-05-08 12:28:04 · 221 阅读 · 0 评论 -
2018年北京信息科技大学第十届程序设计竞赛暨ACM选拔赛 A:建图跑SPFA
链接:https://www.nowcoder.com/acm/contest/118/A来源:牛客网 最近,喜爱ACM的PBY同学沉迷吃鸡,无法自拔,于是又来到了熟悉的ERANGEL。经过一番搜寻,PBY同学准备动身前往安全区,但是,地图中埋伏了许多LYB,PBY的枪法很差,希望你能够帮他找到一条路线,每次只能向上、下、左、右移动,尽可能遇到较少的敌人。输入描述:题目包含多组测试,请处理到文...原创 2018-05-05 20:51:21 · 336 阅读 · 0 评论 -
Codeforces 967A Mind the Gap
A. Mind the Gaptime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThese days Arkady works as an air traffic controller at a large airport. He controls...原创 2018-04-30 20:16:41 · 232 阅读 · 0 评论 -
Codeforces 710C Magic Odd Square
题目链接:http://codeforces.com/problemset/problem/710/CC. Magic Odd Squaretime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFind an n × n matrix ...原创 2018-04-07 12:44:57 · 292 阅读 · 0 评论 -
第十六届金马五校 二进制找规律F:1 + 2 = 3 ?
链接:https://www.nowcoder.com/acm/contest/91/F来源:牛客网小Y在研究数字的时候,发现了一个神奇的等式方程,他屈指算了一下有很多正整数x满足这个等式,比如1和2,现在问题来了,他想知道从小到大第N个满足这个等式的正整数,请你用程序帮他计算一下。 (表示按位异或运算) 输入描述:第一行是一个正整数,表示查询次数。接着有T行,每行有一个正整数,表示小Y...原创 2018-04-16 21:16:03 · 287 阅读 · 0 评论 -
十六届金马五校 I: 二数
链接:https://www.nowcoder.com/acm/contest/91/I来源:牛客网我们把十进制下每一位都是偶数的数字叫做“二数”。 小埃表示自己很聪明,最近他不仅能够从小数到大:2,3,4,5....,也学会了从大数到小:100,99,98...,他想知道从一个数开始数最少的数就得到一个二数。但是聪明的小森已经偷偷在心里算好了小埃会数到哪个二数,请你求出他要数到哪个数吧。 ...原创 2018-04-16 21:11:37 · 200 阅读 · 0 评论 -
Codeforces 910B
题目链接:http://codeforces.com/contest/910/problem/B题意:有长度为n的木板,有2扇一样的门,每个门有需要用2个长度为a的板子和一个长度为b的板子,并且对一个板子不能由剩余木板拼凑而来。题解:可以dp,可以枚举排列、/*#include <bits/stdc++.h>using namespace std;int main(){ ...原创 2018-03-13 11:55:37 · 359 阅读 · 0 评论 -
CF 910A DP
题目链接:http://codeforces.com/contest/910/problem/A题意:给出长度为n的01串,1可以走,0不可一,保证串第一个位置和第n个位置为1,每次可以走1-d步,比如你在x处,你可以走到x+1 ~ x+d之间任何一个为1的地方。DP写法1:复杂度O(n*d),很常规的两层for#include <bits/stdc++.h>using names...原创 2018-03-13 11:53:05 · 265 阅读 · 0 评论 -
牛客练习赛13F
链接:https://www.nowcoder.com/acm/contest/70/F来源:牛客网题目描述在一个n*n的国际象棋棋盘上有m个皇后。 一个皇后可以攻击其他八个方向的皇后(上、下、左、右、左上、右上、左下、右下)。 对于某个皇后,如果某一个方向上有其他皇后,那么这个方向对她就是不安全的。 对于每个皇后,我们都能知道她在几个方向上是不安全的。 现在我们想要求出t0,t1,...,t8,...原创 2018-03-17 23:22:15 · 232 阅读 · 0 评论 -
Codeforces 365C 思维或二分
C. Matrixtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a string of decimal digits s. Let's define bij = si·sj. Find in matrix b ...原创 2018-03-15 23:43:31 · 261 阅读 · 0 评论 -
Codeforces 931E
题意:有一个字符串,可以选择从第K位开始,将[K,len(s)-1]的字符都移到前面去,现在给你一个首字母,你可以再选择一位进行观察,然后猜测这个K的值是多少, 现在要求求出能猜对K的概率是多少。题解:处理出每一个字母开头的第K位是什么字符, 如果这个字符在这个字母中出现的次数为1,那么表示可以通过这一个位置来区分字符串,cnt++,不为一就说明不能区分,那就将上次的计数删除。#include &...原创 2018-03-07 17:38:37 · 237 阅读 · 0 评论 -
Codeforces946E Largest Beautiful Number
题目链接:http://codeforces.com/contest/946/problem/E题意:给出一个数字找出第一个比他小的数,且其长度为偶数,并且可以构成回文。题解:1:首先长度为奇数时,直接输出(N-1)个9。 2:长度为偶数时,枚举答案串和输入串的lcp,对lcp的下一位进行枚举,然后判断是否合法。#include <bits/stdc++.h>us...原创 2018-03-07 17:03:35 · 400 阅读 · 0 评论 -
Codeforces918C思维
#include using namespace std;int main(){ string s; cin >> s;int res=0; int n = s.size(); for(int i = 0;i < n;i ++) { int l,r; l=r=0; //l代表目前的左括号数,r代表把?都当成左括号需要的右括号原创 2018-01-30 01:48:31 · 377 阅读 · 0 评论 -
模拟HDU5929
链接http://acm.hdu.edu.cn/showproblem.php?pid=5929题意:给你一种数据结构以及操作,和一种位运算,最后询问:从‘栈’顶到低的运算顺序结果是多少解法:根据位运算,发现出现0,结果就是1,那么就记录两端0的位置就好,中间不管出现什么,结果大部分都是1,考虑还有反转操作,使用双端队列,用flag标记反转后的情况,然后根据需要添加元素记录位置,最后根据标原创 2018-01-26 23:41:38 · 188 阅读 · 0 评论 -
HihoCoder1683模拟
题目链接:http://hihocoder.com/problemset题解:枚举行数,然后随便模拟下。#include using namespace std;const int N = 10007;using ll = long long ;using ld = long double ;#define ALL(X) begin(X), end(X)#define mp原创 2018-01-15 00:45:04 · 168 阅读 · 0 评论 -
Educational Codeforces Round 903E
Educational Codeforces Round 34 (Rated for Div. 2)原创 2017-12-14 19:45:53 · 532 阅读 · 0 评论 -
牛客多校一 D
链接:https://www.nowcoder.com/acm/contest/139/D来源:牛客网 题目描述Two undirected simple graphs and where are isomorphic when there exists a bijection on V satisfying if and only if {x, y} ∈ E2.Given...原创 2018-07-20 09:04:42 · 277 阅读 · 0 评论
分享