답안 #974299

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974299 2024-05-03T07:45:36 Z vjudge1 Ljeto (COCI21_ljeto) C++17
50 / 50
1 ms 600 KB
#include <iostream>
using namespace std;

int main(){

    int banyak;
    cin >> banyak;
    int lempar[banyak][3];
    int hmm[banyak];
    int skor_a=0, skor_b=0, counter_a = 0, counter_b = 0;

    for(int i=0; i<banyak; i++){
        cin >> lempar[i][0] >> lempar[i][1] >> lempar[i][2];
    }
    for(int m=0; m<banyak; m++){ //deklarasi bool true
        hmm[m] = true;
    }

    for(int j=0; j<banyak; j++){
        for(int k=j; k<banyak-1; k++){
            if(lempar[j][1] == lempar[k+1][1] && abs(lempar[k+1][0] - lempar[j][0]) <= 10 && hmm[k+1] == true){
                if(lempar[k+1][1] >=1 && lempar[k+1][1] <=4){
                    hmm[k+1] = false;
                    counter_a++;
                }    
                else if(lempar[k+1][1] >=5 && lempar[k+1][1] <=8){
                    hmm[k+1] = false;
                    counter_b++;
        }
            }
        }
    }

    for(int l=0; l<banyak; l++){
        if(lempar[l][1] >=1 && lempar[l][1] <=4){
            skor_a += 100;
        }
        else if(lempar[l][1] >=5 && lempar[l][1] <=8){
            skor_b += 100;
        }
    }


    skor_a = skor_a + (counter_a*50);
    skor_b = skor_b + (counter_b*50);

    cout << skor_a << " " << skor_b;    
    
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 600 KB Output is correct
4 Correct 0 ms 348 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 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct