답안 #83592

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
83592 2018-11-09T12:48:41 Z Leonardo_Paes Nizin (COCI16_nizin) C++11
100 / 100
212 ms 23360 KB
#include <bits/stdc++.h>

using namespace std;

#define MAXN 1000100

long long vet[MAXN];

int main(){

    int n;

    cin >> n;

    for(int i=1; i<=n; i++){
        cin >> vet[i];
    }

    int resp=0;

    int atuali=0, atualj=0;

    for(int i=1, j=n; i<j;){
        if(vet[i]+atuali==vet[j]+atualj){
            atuali=atualj=0;
            i++;
            j--;
            continue;
        }
        resp++;
        if(vet[i]+atuali<vet[j]+atualj){
            atuali+=vet[i];
            i++;
            continue;
        }
        else{
            atualj+=vet[j];
            j--;
            continue;
        }
    }
    cout << resp << endl;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 776 KB Output is correct
2 Correct 2 ms 776 KB Output is correct
3 Correct 3 ms 788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 892 KB Output is correct
2 Correct 2 ms 1004 KB Output is correct
3 Correct 2 ms 1068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1068 KB Output is correct
2 Correct 3 ms 1068 KB Output is correct
3 Correct 2 ms 1068 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1100 KB Output is correct
2 Correct 2 ms 1104 KB Output is correct
3 Correct 2 ms 1108 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 1112 KB Output is correct
2 Correct 2 ms 1128 KB Output is correct
3 Correct 2 ms 1144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 17 ms 1784 KB Output is correct
2 Correct 27 ms 2272 KB Output is correct
3 Correct 25 ms 2420 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 81 ms 5116 KB Output is correct
2 Correct 87 ms 6556 KB Output is correct
3 Correct 101 ms 8212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 148 ms 11800 KB Output is correct
2 Correct 173 ms 13788 KB Output is correct
3 Correct 184 ms 16376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 212 ms 19096 KB Output is correct
2 Correct 189 ms 21196 KB Output is correct
3 Correct 188 ms 23360 KB Output is correct