传送门:Problem D https://www.cnblogs.com/violet-acmer/p/9677435.html 题意: 研究人员需要使用某种细菌进行实验,给定一个序列代表接下来每个小时所用的细菌数目,已知初始时细菌的数目为 1 ,其数目每小时会翻倍增长,并且等到第一个小时以后开始实验,问最后残余的细菌数目. 题解: 因为细菌的数目可能会呈指数级上升,所以首先要想到大数. 然后用 java 模拟一下即可,最后别忘了 mod 1e9+7 . AC代码: import java.i…
B:Button Bashing You recently acquired a new microwave, and noticed that it provides a large number of buttons to be able to quickly specify the time that the microwave should be running for. There are buttons both for adding time, and for subtractin…
A - Amsterdam Distance 题意:极坐标系,给出两个点,求最短距离 思路:只有两种方式,取min  第一种,先走到0点,再走到终点 第二种,走到同一半径,再走过去 #include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f const double PI = acos(-1.0); double n, m, r; double n1, m1, n2, m2; inline double work1(…
题目链接:https://vjudge.net/contest/187496#problem/E E Excellent Engineers You are working for an agency that selects the best software engineers from Belgium, the Netherlands and Luxembourg for employment at various international companies. Given the ve…
1.A题 题意:给定第一行的值表示m列的最大值,第m行的值表示n行的最大值,问是否会行列冲突 思路:挺简单的,不过我在一开始理解题意上用了些时间,按我的理解是输入两组数组,找出每组最大数,若相等则输出possible,否则输出impossible,代码很直接用的C语言 1 #include<stdio.h> 2 int main(){ 3 int r,c,i,j; 4 int s[110],b[110]; 5 while(scanf("%d %d",&r,&…
I. Interesting Integers 传送门 应该是叫思维题吧,反正敲一下脑壳才知道自己哪里写错了.要敢于暴力. 这个题的题意就是给你一个数,让你逆推出递推的最开始的两个数(假设一开始的两个数为x和y),而且要求x<=y. 通过找规律可以发现,这个题就是求解a*x+b*y=k这个方程的x和y的值,并且要x和y为最小满足条件的解.可以找规律出一个公式fi[i]*x+(fi[i-1]+fi[i])*y=n.因为不知道n具体是在第几步推出来的,所以for循环跑一遍预处理出来的斐波那契数列(存…
G. Growling Gears 传送门 此题为签到题,直接中学的数学知识点,一元二次方程的顶点公式(-b/2*a,(4*a*c-b*b)/4*a):直接就可以得到结果. 代码: #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<cstdlib> #include<queue> #include<map> #inc…
先写这几道题,比赛的时候有事就只签了个到. 题目传送门 E. Excellent Engineers 传送门 这个题的意思就是如果一个人的r1,r2,r3中的某一个比已存在的人中的小,就把这个人添加到名单中. 因为是3个变量,所以按其中一个变量进行sort排序,然后,剩下的两个变量,一个当位置pos,一个当值val,通过线段树的单点更新和区间最值操作,就可以把名单确定. 代码: //E-线段树 #include<iostream> #include<cstdio> #include…
// Button Bashing (bfs) 1 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <set> #include <map> #include <vector> #include <cmath> #include <queue> using namespace…
目录 Contest Info Solutions A A Prize No One Can Win B Birthday Boy C Cardboard Container D Driver Disagreement E Entirely Unsorted Sequences F Financial Planning G Game Night H Harry the Hamster I In Case of an Invasion, Please. . . J Janitor Troubles…