Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. /**
  2. TASK:
  3. USER: gabriel90
  4. LANG: C++
  5. **/
  6. #include <bits/stdc++.h>
  7. using namespace std;
  8.  
  9. #define forn(i, n) for(int i=0; i<(n); i++)
  10. #define readVec(v) forn(i, v.size()){cin >> v[i];}
  11. #define pb push_back
  12. #define mp make_pair
  13. #define MOD 1000000007
  14. #define f first
  15. #define s second
  16.  
  17. typedef long long ll;
  18. typedef double ld;
  19. typedef long double lld;
  20. typedef pair<int, int> pii;
  21. typedef pair<ll, ll> pll;
  22. typedef vector<int> vi;
  23. typedef vector<ll> vl;
  24. typedef vector<bool> vb;
  25. typedef vector<pii> vpi;
  26. typedef vector<pll> vpl;
  27. typedef vector<vi> vii;
  28.  
  29. //Printing pairs and vectors
  30. template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
  31. template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
  32. cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
  33. }
  34.  
  35. //2 147 483 647 int max
  36. //9 223 372 036 854 775 807 ll max
  37. void fast_io(){
  38. ios_base::sync_with_stdio(0);
  39. cin.tie(NULL);
  40. cout.tie(NULL);
  41. }
  42. void file_io(string taskname){
  43. string fin = taskname + ".in";
  44. string fout = taskname + ".out";
  45. const char* FIN = fin.c_str();
  46. const char* FOUT = fout.c_str();
  47. freopen(FIN, "r", stdin);
  48. freopen(FOUT, "w", stdout);
  49. fast_io();
  50. }
  51.  
  52. int main(){
  53. fast_io();
  54. int n;
  55. ll k;
  56. cin >> n >> k;
  57. vl ratings(n);
  58. forn(i,n){
  59. cin >> ratings[i];
  60. }
  61. ll s = 0;
  62. ll cn = n;
  63. int j = 1;
  64. forn(i,n){
  65. ll d = s -(cn-(j))*i*ratings[i];
  66. //cout << (i+1) << " " << d << endl;
  67. if(d >= k){
  68. s += ratings[i] * (j-1);
  69. j++;
  70.  
  71. }else{
  72. cn--;
  73. cout << (i+1) << "\n";
  74. }
  75. }
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement