CF_315C_Sereja and Contest

这是一道坑爹的阅读题。。。

根据公式:

前面的值不会影响后面,每个rating有两种选择状态:选或不选,所以扫描一遍就够了

#include <cstdio>
#include <queue>
#include <cstring>
#include <algorithm>
#include <cmath>
#include<vector>
using namespace std;
#define LL long long
int main()
{
   int n,k,a;
   while(~scanf("%d%d",&n,&k))
   {
      int index=1; //当前队列有多少个元素
      LL res=0;
       scanf("%d",&a);
      for(int i=2;i<=n;++i)
      {
          scanf("%d",&a);
          if(res-(LL)index*(n-i)*a<k)
          printf("%d\n",i);
          else 
          {
              res+=(LL)index*a;
              index++;
          }
      }
   }
   return 0;
}

 

posted @ 2013-06-08 18:19  小仪在努力~  阅读(150)  评论(0编辑  收藏  举报