比赛笔试链接:http://hihocoder.com/contest/ntest2015april/problems 题目就不贴了. 1.推箱子. 思路:纯模拟. 代码(28MS): #include <bits/stdc++.h> using namespace std; ; const char str_op[] = "dulr"; , -, , }; , , -, }; inline int id(char c) { static const char op[] =…
题目1 : Magic Box 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 The circus clown Sunny has a magic box. When the circus is performing, Sunny puts some balls into the box one by one. The balls are in three colors: red(R), yellow(Y) and blue(B). Let Cr, Cy, Cb…
def printindex(n,arr): # n = int(input()) # arr = list(map(int,input().split(' '))) li1=[] li2=[] for i in range(n): if(arr[i]<0): li1.append(i) else: li2.append(i) index = 0 for i in li2: for j in li1: if abs(arr[i]>abs(arr[j])): index +=abs(j-i)*a…
题目2 : Professor Q's Software 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Professor Q develops a new software. The software consists of N modules which are numbered from 1 to N. The i-th module will be started up by signal Si. If signal Si is generated mul…
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 A string s is LUCKY if and only if the number of different characters in s is a fibonacci number. Given a string consisting of only lower case letters, output all its lucky non-empty substrings in lexicographica…
传送门 题目2 : Professor Q's Software 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Professor Q develops a new software. The software consists of N modules which are numbered from 1 to N. The i-th module will be started up by signal Si. If signal Si is generated…
时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 A company plans to recruit some new employees. There are N candidates (indexed from 1 to N) have taken the recruitment examination. After the examination, the well-estimated ability value as well as the expected…
题目3 : Spring Outing 时间限制:20000ms 单点时限:1000ms 内存限制:256MB 描述 You class are planning for a spring outing. N people are voting for a destination out of K candidate places. The voting progress is below: First the class vote for the first candidate place.…
1.Splitting the Field http://usaco.org/index.php?page=viewproblem2&cpid=645 给二维坐标系中的n个点,求ans=用一个矩形覆盖所有点所用矩形面积-用两个矩形覆盖所有点所用两个矩形的最小面积和,而且两个矩形不能重合(边重合也不行) 枚举两个矩形的分割线,也就是把所有点分成两个部分,枚举分割点:先预处理每个点之前和之后的最大,最低高度 #include<algorithm> #include<cstdio>…
题目来源:补提交卡 解题思路:假设未提交程序的天数为:a1,a2,....,an,补交的张数为M.依次从a1,a2,....,an中去掉连续的 K 天(0<=K<=M),然后再来计算剩余数组中最长连续提交天数. 具体算法(Java版,直接AC) import java.util.Scanner; public class Main { //计算数组中最长连续提交天数 public static int getMax(int[] array) { int[] copy = new int[arr…