关闭

CF 314A(Sereja and Contest-这题题目索性没看懂,E文是硬伤)

1466人阅读 评论(0) 收藏 举报
分类:

C. Sereja and Contest
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

During the last Sereja's Codesecrof round the server crashed many times, so the round was decided to be made unrated for some participants.

Let's assume that n people took part in the contest. Let's assume that the participant who got the first place has rating a1, the second place participant has rating a2..., the n-th place participant has rating an. Then changing the rating on the Codesecrof site is calculated by the formula .

After the round was over, the Codesecrof management published the participants' results table. They decided that if for a participant di < k, then the round can be considered unrated for him. But imagine the management's surprise when they found out that the participants' rating table is dynamic. In other words, when some participant is removed from the rating, he is removed from the results' table and the rating is recalculated according to the new table. And of course, all applications for exclusion from the rating are considered in view of the current table.

We know that among all the applications for exclusion from the rating the first application to consider is from the participant with the best rank (the rank with the minimum number), for who di < k. We also know that the applications for exclusion from rating were submitted by all participants.

Now Sereja wonders, what is the number of participants to be excluded from the contest rating, and the numbers of the participants in the original table in the order of their exclusion from the rating. Pay attention to the analysis of the first test case for a better understanding of the statement.

Input

The first line contains two integers nk (1 ≤ n ≤ 2·105,  - 109 ≤ k ≤ 0). The second line contains n space-separated integersa1, a2, ..., an (1 ≤ ai ≤ 109) — ratings of the participants in the initial table.

Output

Print the numbers of participants in the order in which they were removed from the table. Print the initial numbers of the participants, that is, the numbers that the participants had in the initial table.

Sample test(s)
input
5 0
5 3 4 1 2
output
2
3
4
input
10 -10
5 5 1 7 5 1 2 4 9 2
output
2
4
5
7
8
9
Note

Consider the first test sample.

  • Initially the sequence of the contest participants' ratings equals [5, 3, 4, 1, 2]. You can use this sequence to calculate the sequence of rating changes: [0, -9, -13, 8, 14]. According to the problem statement, the application of the participant who won the second place will be considered first.

  • As soon as the second place winner is out from the ratings, the participants' rating sequence will equal [5, 4, 1, 2]. By this sequence you can count the new sequence of rating changes: [0, -8, 2, 6]. According to the problem statement, the application of the participant who won the second place will be considered. Initially this participant won third place.

  • The new rating sequence equals [5, 1, 2], the new sequence of rating changes equals [0, -1, 1]. The second place participant's application is taken into consideration, initially this participant won the fourth place.

  • The new rating sequence equals [5, 2], the new sequence of rating changes equals [0, 0]. No more applications will be considered.

    Thus, you should print 2, 3, 4.


  • 完全看不懂题.

    以为要动态维护,不断循环,直到无法Unrated

    事实上,本题的意思是

    从头到尾进行删除,删除可能改变表中数据,问最后谁会Unrated

    注意只要扫1遍……赤裸裸的模拟……

    E文太差伤不起

    #include<cstdio>
    #include<cstring>
    #include<cstdlib>
    #include<algorithm>
    #include<functional>
    #include<iostream>
    #include<cmath>
    #include<cctype>
    #include<ctime>
    using namespace std;
    #define For(i,n) for(int i=1;i<=n;i++)
    #define Fork(i,k,n) for(int i=k;i<=n;i++)
    #define Rep(i,n) for(int i=0;i<n;i++)
    #define ForD(i,n) for(int i=n;i;i--)
    #define RepD(i,n) for(int i=n;i>=0;i--)
    #define Forp(x) for(int p=pre[x];p;p=next[p])
    #define MAXN (200000+10)
    long long n,k,a[MAXN];
    int main()
    {
        cin>>n>>k;
        long long tmp=0;
        int j=1;
        For(i,n)
        {
            long long a;
            cin>>a;
            if (tmp-(i-1)*(n-i)*a<k)
            {
                cout<<j<<endl;
                n--;i--;
            }
            else tmp+=a*(i-1);
    
            j++;
        }
    	return 0;
    }
    



    0
    0
    查看评论

    Sereja and Bottles-水题有点坑爹

    CodeForces - 315A Sereja and Bottles Time Limit: 2000MS   Memory Limit: 262144KB   64bit IO Format: %I64d &...
    • qq_18661257
    • qq_18661257
    • 2015-07-30 01:33
    • 1023

    一些CF题目

    做了一些莲辉挂的CF题。。选一些来讲讲。 D. Guess Your Way Out! II time limit per test 2 seconds memory limit per test 256 megabytes input standard input output stand...
    • u011481752
    • u011481752
    • 2015-08-03 00:13
    • 345

    论弱逼的自我修养——2014集训队CF试题泛做

    为了增长姿势水平提高思考能力,我决定跟着神犇膜一膜2014的集训队作业; 似乎大多数是CF上的DE题,应该比较有含金量(然而博主是个div2连D都没做上过的**); 感觉不久就会弃坑吧,大家来猜猜窝能坚持几道题吧!
    • ww140142
    • ww140142
    • 2015-11-26 20:15
    • 1558

    【Codeforces314E】Sereja and Squares

    题意: 给你一个仅含小写字母和‘?’的字符串,你需要将问号处填上小写或者大写字母,统计满足下列要求的方案数:(对109+710^9+7取模) 每个小写字母都有向后匹配的对应大写字母,并且没有剩余的大写字母。 每两对对应的小大写字母构成的区间[l1,r1],[l2,r2][l_1,r_1],[l_2,...
    • wzf_2000
    • wzf_2000
    • 2017-12-19 14:50
    • 86

    CF 315A(Sereja and Bottles-开易拉罐)

    A. Sereja and Bottles time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o...
    • nike0good
    • nike0good
    • 2013-06-08 08:28
    • 1794

    poj-2251 Dungeon Master【bfs】

    很基础的一道bfs /*这题是一个三维的迷宫题目,其中用'.'表示空地,'#'表示障碍物,'S'表示起点,'E'表示终点, 求从起点到终点的最小移动次数,解法和二维的类似, 只是在行动时除了东南西北移动外还多了上下。 对于题目给出数据的...
    • a915800048
    • a915800048
    • 2016-03-30 13:22
    • 210

    【poj 2251】 Dungeon Master 题意&题解&代码(C++)

    poj
    • DERITt
    • DERITt
    • 2016-03-22 22:04
    • 400

    CFF2016 想了一会儿的题目

    渣渣不怎么会,很多都只是看一下题目 下面这些题目都是想了几次才想出来的 总是lose的程序 稍微拿ida看了一下,发现scanf那儿可以覆盖v5的值,也就是可以把v5要执行的函数给换掉,原来v5执行的函数是lose,我之前直接改成 read_flag的地址,脚本是这样 read_fla...
    • xuqi7
    • xuqi7
    • 2016-06-20 00:06
    • 1498

    2017年美国数学建模MCM/ICM ABCDEF试题分析

    六道题目为别人分析所得,自己也是借鉴,分享给大家,美赛还剩两天,参赛的童鞋加油哈,刚刚逛到的别人分享资料链接,一同附上,给大家参考,祝各位都能取得好的成绩!! 2017美国数学建模A题 思路 以及参考文献几十篇 http://www.mathsccnu.com/forum.php?mod=viewt...
    • Jian_Yun_Rui
    • Jian_Yun_Rui
    • 2017-01-21 20:35
    • 7837

    codeforces题目分类

    多写写cf上的题吧。 以前写的题都没记录,从今天开始记录吧。 记录一下写过的题的做法和分类吧。388A(贪心) 388B(一个不错的构造题,二进制构造)
    • luotuoqingshan
    • luotuoqingshan
    • 2016-09-07 15:01
    • 1581
      个人资料
      • 访问:991757次
      • 积分:20360
      • 等级:
      • 排名:第484名
      • 原创:1028篇
      • 转载:16篇
      • 译文:0篇
      • 评论:34条
      博客导航
      文章分类
      最新评论