Submission #1865299


Source Code Expand

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define pb push_back
using namespace std;
const int INF = 1e9;
typedef long long ll;

int main(){
  ll n,a,b;
  cin >> n >> a >> b;
  vector <ll> h;
  REP(i,n){
    ll c;
    cin >> c;
    h.pb(c);
  }
  ll num = 0;
  sort(h.begin(),h.end(),greater<ll>());
  while(1){
    h[0] -= a;
    for(int i = 1;i < h.size();i++){
      h[i] -= b;
    }
    if(h[0] <= h[1])
      sort(h.begin(),h.end(),greater<ll>());
    num++;
    if(h[0] <= 0)
      break;
  }
  cout << num << endl;
  return 0;
}

Submission Info

Submission Time
Task D - Widespread
User kodamune
Language C++14 (GCC 5.4.1)
Score 0
Code Size 664 Byte
Status TLE
Exec Time 2103 ms
Memory 1400 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 2
TLE × 1
AC × 4
TLE × 9
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 1 ms 256 KB
a02 AC 1 ms 256 KB
a03 TLE 2103 ms 256 KB
b04 AC 1 ms 256 KB
b05 AC 49 ms 1400 KB
b06 TLE 2103 ms 1400 KB
b07 TLE 2103 ms 1400 KB
b08 TLE 2103 ms 1400 KB
b09 TLE 2103 ms 1400 KB
b10 TLE 2103 ms 1400 KB
b11 TLE 2103 ms 1400 KB
b12 TLE 2103 ms 1400 KB
b13 TLE 2103 ms 1400 KB