Sunday, July 20, 2014

Codeforces Round #257 (Div. 2), problem: (A) Jzzhu and Children solution

Codeforces Round #257 (Div. 2), problem: (A) Jzzhu and Children: http://codeforces.com/contest/450/problem/A

Codeforces Round #257 (Div. 2), problem: (A) Jzzhu and Children editorial: http://codeforces.com/blog/entry/13112

Codeforces Round #257 (Div. 2), problem: (A) Jzzhu and Children solution: http://ideone.com/KzA5Ou


#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;

int main() {
    int n, m, a[105], idx=-1, ma=-1;
    scanf("%d%d", &n, &m);
    for(int i=0; i<n; i++) scanf("%d", &a[i]), a[i]=ceil((double)a[i]/m);
    for(int i=n-1; i>=0; i--) if(a[i]>ma) ma=a[i], idx=i;
    printf("%d", idx+1);
    return 0;
}


No comments:

Post a Comment