BestCoder Sequence Problem Description Mr Potato is a coder. Mr Potato is the BestCoder. One night, an amazing sequence appeared in his dream. Length of this sequence is odd, the median number is M, and he named this sequence as Bestcoder Sequence. A…
Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 354    Accepted Submission(s): 100 Problem Description ZYB has a tree with N nodes,now he wants you to solve the numbers of nodes distanced no m…
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 175    Accepted Submission(s): 74 Problem Description ZYB has a premutation P,but he only remeber the reverse log of each prefix of the premutat…
Task schedule Problem Description 有一台机器,而且给你这台机器的工作表.工作表上有n个任务,机器在ti时间运行第i个任务,1秒就可以完毕1个任务. 有m个询问,每一个询问有一个数字q.表示假设在q时间有一个工作表之外的任务请求,请计算何时这个任务才干被运行. 机器总是依照工作表运行,当机器空暇时马上运行工作表之外的任务请求.   Input 输入的第一行包括一个整数T, 表示一共同拥有T组測试数据. 对于每组測试数据: 第一行是两个数字n, m,表示工作表里面有…
BestCoder Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 271    Accepted Submission(s): 112 Problem Description Mr Potato is a coder. Mr Potato is the BestCoder. One night, an amazing…
# include <stdio.h> # include <algorithm> using namespace std; int main() { int n,m,i,sum,cot,flag,j; int map[80040]; int a[40010]; int ans1; int ans2; while(~scanf("%d%d",&n,&m)) { ans1=ans2=40010; memset(map,0,sizeof(map));…
Poor Hanamichi Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 743    Accepted Submission(s): 275 Problem Description Hanamichi is taking part in a programming contest, and he is assigned to so…
GT and numbers 问题描述 给出两个数NN和MM. NN每次可以乘上一个自己的因数变成新的NN. 求最初的NN到MM至少需要几步. 如果永远也到不了输出-1−1. 输入描述 第一行读入一个数TT表示数据组数. 接下来TT行,每行两个数NN和MM. T\leq1000T≤1000, 1\leq N \leq 10000001≤N≤1000000,1 \leq M \leq 2^{63}1≤M≤2​63​​. 注意M的范围.hack时建议输出最后一行的行末回车;每一行的结尾不要输出空格.…
比赛链接 A题主要是map的使用,比赛的时候问了下队友,下次要记住了 #include<bits/stdc++.h> using namespace std; typedef long long LL; LL T,n; map<string,int> mp1,mp2; int main() { cin>>T; while(T--) { mp1.clear();mp2.clear(); cin>>n; ;i<n;i++) { string str; in…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4908 BestCoder Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 618    Accepted Submission(s): 214 Problem Description Mr Potato is a code…