[题意]一共有N个任务和M天,一个人一天只能做一个任务,做完任务之后可以在这一天之后的(Ai-1)天拿到Bi的工资,问M天内最多可以拿到多少工资. 链接:https://atcoder.jp/contests/abc137/tasks/abc137_d [思路]按时间将任务排序,把 ii 时刻能做的任务都扔进堆里 , 因为任务是一次性的,所以每个任务放进去过就不再放入了.然后每个时刻看一下堆里面有没有数,有的话就取堆顶出来,而且每个时刻只能取一次.正确性显然. 代码: #include<bits…
AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) \[x=i,g(x)=0\] \[x\ne i ,g(x)=1\] 则我们可以构造 \[f(x)=\sum^{i=0}_{P-1}(-a_i*(x-i)^{P-1}+a_i)\] 对于第\(i\)条式子当且仅当\(a_i=1 \ and \ x=i\)时取到\(1\) 代码写的比较奇怪 const…
A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contest, AtCoder Beginner Contest, is abbreviated as ABC. When we refer to a specific round of ABC, a three-digit number is appended after ABC. For example,…
A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200, and participate in AtCoder Regular Contest (ARC) oth…
题目链接:http://abc069.contest.atcoder.jp/assignments A - K-City Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement In K-city, there are n streets running east-west, and m streets running north-south. Each street running east-w…
A - Addition and Subtraction Easy Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Joisino wants to evaluate the formula "A op B". Here, A and B are integers, and the binary operator op is either + or -. Your task is…
题目链接:http://abc070.contest.atcoder.jp/assignments A - Palindromic Number Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement You are given a three-digit positive integer N.Determine whether N is a palindromic number.Here, a…
A - Remaining Time Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.In this country, 24-hour clock is used. For example, 9:00 p.m. is re…
A - Haiku Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement As a New Year's gift, Dolphin received a string s of length 19.The string s has the following format: [five lowercase English letters],[seven lowercase English le…
前言 又是卡在了T4 , 总分 100 + 200 + 300 = 600pts rank 2449.以后还是要多积累比赛经验. A 输出a+b,a-b,a*b中最大的数,还要多简单?不挂代码了 B 题目描述 数字线上有2000001块石头.这些石头的坐标是- 1000000,- 999999 ,- 999998 ,... ,999999 ,1000000.其中,一些ķ连续的石头涂成黑色,其他石头涂成白色.另外,我们知道坐标X处的石头黑色的.打印所有可能包含黑色石头的坐标,按升序排列. 数据范围…