↓ Skip to main content
  1. Categories/

ACM

2015

codeforces #326 div 2 A. Duff and Meat(水)

·503 words·2 mins
A. Duff and Meat time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Duff is addicted to meat! Malek wants to keep her happy for n days. In order to be happy in i-th day, she needs to eat exactly a__i kilograms of meat. There is a big shop uptown and Malek wants to buy meat for her from there. In i-th day, they sell meat for p__i dollars per kilogram. Malek knows all numbers _a_1, …, a__n and _p_1, …, p__n. In each day, he can buy arbitrary amount of meat, also he can keep some meat he has for the future.

zoj 3635 Cinema in Akiba (树状数组求第K大)

·716 words·2 mins
Cinema in Akiba Cinema in Akiba (CIA) is a small but very popular cinema in Akihabara. Every night the cinema is full of people. The layout of CIA is very interesting, as there is only one row so that every audience can enjoy the wonderful movies without any annoyance by other audiences sitting in front of him/her. The ticket for CIA is strange, too. There are n seats in CIA and they are numbered from 1 to n in order. Apparently, n tickets will be sold everyday. When buying a ticket, if there are k tickets left, your ticket number will be an integer i (1 ≤ i ≤ k), and you should choose theith empty seat (not occupied by others) and sit down for the film.

zoj 3625 D - Geek's Collection(正项无穷级数,麦克劳林展开式,2015年10月AC)

·977 words·2 mins
D - Geek’s Collection **Time Limit:**2000MS **Memory Limit:**65536KB 64bit IO Format:%lld & %llu Submit Status Description The word geek is a slang term, with different meanings ranging from “a computer expert or enthusiast” to “a carnival performer who performs sensationally morbid or disgusting acts”, with a general pejorative meaning of “a peculiar or otherwise dislikable person, especially one who is perceived to be overly intellectual”. The definition of geek has changed considerably over time, and there is no longer a definitive meaning. The terms nerd, gimp, dweeb, dork, spod and gump have similar meanings as geek, but many choose to identify different connotations among these terms, although the differences are disputed. In a 2007 interview on The Colbert Report, Richard Clarke said the difference between nerds and geeks is “geeks get it done.” Julie Smith defined a geek as “a bright young man turned inward, poorly socialized, who felt so little kinship with his own planet that he routinely traveled to the ones invented by his favorite authors, who thought of that secret, dreamy place his computer took him to as cyberspace somewhere exciting, a place more real than his own life, a land he could conquer, not a drab teenager’s room in his parents’ house.“The definition of geek has changed considerably over time, and there is no longer a definitive meaning. The terms nerd, gimp, dweeb, dork, spod and gump have similar meanings as geek, but many choose to identify different connotations among these terms, although the differences are disputed. In a 2007 interview on The Colbert Report, Richard Clarke said the difference between nerds and geeks is “geeks get it done.” Julie Smith defined a geek as “a bright young man turned inward, poorly socialized, who felt so little kinship with his own planet that he routinely traveled to the ones invented by his favorite authors, who thought of that secret, dreamy place his computer took him to as cyberspace somewhere exciting, a place more real than his own life, a land he could conquer, not a drab teenager’s room in his parents’ house.”

51nod 1106 质数检测(miller rabin 素数测试.)

·373 words·1 min
1106 质数检测 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 给出N个正整数,检测每个数是否为质数。如果是,输出"Yes",否则输出"No"。

hdu 2531 Catch him (bfs)

·1300 words·3 mins
Catch him # **Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 664 Accepted Submission(s): 307 ** Problem Description 在美式足球中,四分卫负责指挥整只球队的进攻战术和跑位,以及给接球员传球的任务。四分卫是一只球队进攻组最重要的球员,而且一般身体都相对比较弱小,所以通常球队会安排5-7名大汉来保护他,其中站在四分卫前方、排成一线的5名球员称为进攻锋线,他们通常都是135公斤左右的壮汉。

codeforces #324 div 2 A. Olesya and Rodion

·377 words·1 min
A. Olesya and Rodion time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Olesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfies both of them. Your task is: given the n and t print an integer strictly larger than zero consisting of n digits that is divisible by t. If such number doesn’t exist, print - 1. Input

51nod_learn_greedy_活动安排2

·532 words·2 mins
有若干个活动,第i个开始时间和结束时间是[Si,fi),同一个教室安排的活动之间不能交叠,求要安排所有活动,最少需要几个教室? 1第一行一个正整数n (n <= 10000)代表活动的个数。 2第二行到第(n + 1)行包含n个开始时间和结束时间。 3开始时间严格小于结束时间,并且时间都是非负整数,小于1000000000 输出 一行包含一个整数表示最少教室的个数。 输入示例

codeforces #323 div 2 C. GCD Table (暴力?)

·960 words·2 mins
C. GCD Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The GCD table G of size n × n for an array of positive integers a of length n is defined by formula Let us remind you that the greatest common divisor (GCD) of two positive integers x and y is the greatest integer that is divisor of both x and y, it is denoted as . For example, for array a = {4, 3, 6, 2} of length 4 the GCD table will look as follows: