This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |