Submission #18654

# Submission time Handle Problem Language Result Execution time Memory
18654 2016-02-13T11:14:50 Z suhgyuho_william Horses (IOI15_horses) C++
34 / 100
56 ms 12812 KB
#include "horses.h"

int N;
long long x[500002],y[500002];

#define MOD 1000000007

int process1(){
	int i,t;
	long long ans,tmp;

    ans = x[1];
    t = tmp = 1;
    for(i=2; i<=N; i++){
		tmp *= x[i];
		if(tmp > y[t] || tmp*y[i] > y[t]){
			t = i;
			ans *= (tmp%MOD); ans %= MOD;
			tmp = 1;
		}
    }
    ans *= y[t];
    ans %= MOD;

	return (int)ans;
}

int init(int n, int X[], int Y[]) {
    int i;

    for(i=1; i<=n; i++){
		x[i] = (long long)X[i-1];
		y[i] = (long long)Y[i-1];
    }
    N = n;
    if(N <= 1000){
		return process1();
    }

}

int updateX(int pos, int val) {
	if(N <= 1000){
		x[pos+1] = (long long)val;
		return process1();
	}
}

int updateY(int pos, int val) {
	if(N <= 1000){
		y[pos+1] = (long long)val;
		return process1();
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
6 Correct 0 ms 8900 KB Output is correct
7 Correct 0 ms 8900 KB Output is correct
8 Correct 0 ms 8900 KB Output is correct
9 Correct 0 ms 8900 KB Output is correct
10 Correct 0 ms 8900 KB Output is correct
11 Correct 0 ms 8900 KB Output is correct
12 Correct 0 ms 8900 KB Output is correct
13 Correct 0 ms 8900 KB Output is correct
14 Correct 0 ms 8900 KB Output is correct
15 Correct 0 ms 8900 KB Output is correct
16 Correct 0 ms 8900 KB Output is correct
17 Correct 0 ms 8900 KB Output is correct
18 Correct 0 ms 8900 KB Output is correct
19 Correct 0 ms 8900 KB Output is correct
20 Correct 0 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
6 Correct 0 ms 8900 KB Output is correct
7 Correct 0 ms 8900 KB Output is correct
8 Correct 0 ms 8900 KB Output is correct
9 Correct 0 ms 8900 KB Output is correct
10 Correct 0 ms 8900 KB Output is correct
11 Correct 0 ms 8900 KB Output is correct
12 Correct 0 ms 8900 KB Output is correct
13 Correct 0 ms 8900 KB Output is correct
14 Correct 0 ms 8900 KB Output is correct
15 Correct 0 ms 8900 KB Output is correct
16 Correct 0 ms 8900 KB Output is correct
17 Correct 0 ms 8900 KB Output is correct
18 Correct 0 ms 8900 KB Output is correct
19 Correct 0 ms 8900 KB Output is correct
20 Correct 0 ms 8900 KB Output is correct
21 Correct 0 ms 8900 KB Output is correct
22 Correct 0 ms 8900 KB Output is correct
23 Correct 3 ms 8900 KB Output is correct
24 Correct 3 ms 8900 KB Output is correct
25 Correct 8 ms 8900 KB Output is correct
26 Correct 7 ms 8900 KB Output is correct
27 Correct 0 ms 8900 KB Output is correct
28 Correct 5 ms 8900 KB Output is correct
29 Correct 2 ms 8900 KB Output is correct
30 Correct 5 ms 8900 KB Output is correct
31 Correct 2 ms 8900 KB Output is correct
32 Correct 2 ms 8900 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 12812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
6 Correct 0 ms 8900 KB Output is correct
7 Correct 0 ms 8900 KB Output is correct
8 Correct 0 ms 8900 KB Output is correct
9 Correct 0 ms 8900 KB Output is correct
10 Correct 0 ms 8900 KB Output is correct
11 Correct 0 ms 8900 KB Output is correct
12 Correct 0 ms 8900 KB Output is correct
13 Correct 0 ms 8900 KB Output is correct
14 Correct 0 ms 8900 KB Output is correct
15 Correct 0 ms 8900 KB Output is correct
16 Correct 0 ms 8900 KB Output is correct
17 Correct 0 ms 8900 KB Output is correct
18 Correct 0 ms 8900 KB Output is correct
19 Correct 0 ms 8900 KB Output is correct
20 Correct 0 ms 8900 KB Output is correct
21 Correct 0 ms 8900 KB Output is correct
22 Correct 0 ms 8900 KB Output is correct
23 Correct 4 ms 8900 KB Output is correct
24 Correct 3 ms 8900 KB Output is correct
25 Correct 9 ms 8900 KB Output is correct
26 Correct 9 ms 8900 KB Output is correct
27 Correct 0 ms 8900 KB Output is correct
28 Correct 5 ms 8900 KB Output is correct
29 Correct 3 ms 8900 KB Output is correct
30 Correct 5 ms 8900 KB Output is correct
31 Correct 2 ms 8900 KB Output is correct
32 Correct 0 ms 8900 KB Output is correct
33 Incorrect 0 ms 12812 KB Output isn't correct
34 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 8900 KB Output is correct
2 Correct 0 ms 8900 KB Output is correct
3 Correct 0 ms 8900 KB Output is correct
4 Correct 0 ms 8900 KB Output is correct
5 Correct 0 ms 8900 KB Output is correct
6 Correct 0 ms 8900 KB Output is correct
7 Correct 0 ms 8900 KB Output is correct
8 Correct 0 ms 8900 KB Output is correct
9 Correct 0 ms 8900 KB Output is correct
10 Correct 0 ms 8900 KB Output is correct
11 Correct 0 ms 8900 KB Output is correct
12 Correct 0 ms 8900 KB Output is correct
13 Correct 0 ms 8900 KB Output is correct
14 Correct 0 ms 8900 KB Output is correct
15 Correct 0 ms 8900 KB Output is correct
16 Correct 0 ms 8900 KB Output is correct
17 Correct 0 ms 8900 KB Output is correct
18 Correct 0 ms 8900 KB Output is correct
19 Correct 0 ms 8900 KB Output is correct
20 Correct 0 ms 8900 KB Output is correct
21 Correct 0 ms 8900 KB Output is correct
22 Correct 0 ms 8900 KB Output is correct
23 Correct 4 ms 8900 KB Output is correct
24 Correct 3 ms 8900 KB Output is correct
25 Correct 8 ms 8900 KB Output is correct
26 Correct 9 ms 8900 KB Output is correct
27 Correct 2 ms 8900 KB Output is correct
28 Correct 6 ms 8900 KB Output is correct
29 Correct 3 ms 8900 KB Output is correct
30 Correct 5 ms 8900 KB Output is correct
31 Correct 2 ms 8900 KB Output is correct
32 Correct 0 ms 8900 KB Output is correct
33 Incorrect 24 ms 12812 KB Output isn't correct
34 Halted 0 ms 0 KB -