답안 #921701

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
921701 2024-02-04T09:13:39 Z coding_snorlax 말 (IOI15_horses) C++14
34 / 100
1500 ms 12292 KB
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int n;
int x[500005]={100,100,100,100,100,100,100,100,100,100,100,100,100,100,100};
int y[500005]={100,100,100,100,100,100,100,100,100,100,100,100,100,100,100};
int init(int N, int X[], int Y[]) {
    n=N;
    for(ll i=0;i<N;i++){
      x[i]=X[i];
      y[i]=Y[i];
    }
    ll answer = 1,tmp=1,i=-1;
    for(ll I=N-1;I>=0;I--){
        if(tmp*X[I]>2000000000) {i=I;break;}
        tmp *= X[I];
    }
    if(i==-1) i=0;
    ll place = i;
    ll Max=1,tmp2=1;
    for(ll j=i;j<N;j++){
        tmp2*=Y[j];
        if(tmp2>Max){
            Max = tmp2;
            place = j;
        }
        tmp2/=Y[j];
        if(j!=N-1) tmp2*=X[j+1];
    }
    for(ll j=0;j<=place;j++){
        answer*=X[j];
        answer %= (1000000007);
    }
    answer*=Y[place];
    answer %= 1000000007;
    return answer;
}

int updateX(int pos, int val) {
    x[pos]=val;
    return init(n,x,y);
}
int updateY(int pos, int val) {
    y[pos]=val;
    return init(n,x,y);
}

Compilation message

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:37:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   37 |     return answer;
      |            ^~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 452 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 600 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 448 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 452 KB Output is correct
21 Correct 0 ms 344 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 6 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 6 ms 484 KB Output is correct
26 Correct 5 ms 348 KB Output is correct
27 Correct 6 ms 456 KB Output is correct
28 Correct 6 ms 348 KB Output is correct
29 Correct 6 ms 456 KB Output is correct
30 Correct 5 ms 348 KB Output is correct
31 Correct 5 ms 348 KB Output is correct
32 Correct 6 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1561 ms 10580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 452 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 600 KB Output is correct
8 Correct 1 ms 444 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 448 KB Output is correct
19 Correct 1 ms 348 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 448 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 6 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 6 ms 344 KB Output is correct
26 Correct 6 ms 348 KB Output is correct
27 Correct 6 ms 460 KB Output is correct
28 Correct 6 ms 344 KB Output is correct
29 Correct 6 ms 348 KB Output is correct
30 Correct 5 ms 348 KB Output is correct
31 Correct 5 ms 344 KB Output is correct
32 Correct 6 ms 348 KB Output is correct
33 Execution timed out 1512 ms 12292 KB Time limit exceeded
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 444 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 604 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
23 Correct 6 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 5 ms 344 KB Output is correct
26 Correct 6 ms 500 KB Output is correct
27 Correct 6 ms 348 KB Output is correct
28 Correct 6 ms 348 KB Output is correct
29 Correct 6 ms 484 KB Output is correct
30 Correct 5 ms 348 KB Output is correct
31 Correct 5 ms 344 KB Output is correct
32 Correct 5 ms 344 KB Output is correct
33 Execution timed out 1532 ms 10420 KB Time limit exceeded
34 Halted 0 ms 0 KB -