Hello, i’m having an issue when i try to answer this problem :
My answer get a Compilation error when i submit it on codechef but when i run the test case using a codechef also. it doesnt give any compilation error. The Compilation error say this
{standard input}: Assembler messages:
{standard input}: Fatal error: can’t write 38 bytes to section .comment of /home/nFTYXb/ccPTK0by.o because: ‘No space left on device’
{standard input}: Fatal error: can’t close /home/nFTYXb/ccPTK0by.o: No space left on device
I dont know what that means, can somebody please help me?
My code is like this :
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin>>T;
for(int tt = 0; tt<T; tt++){
int selisihGoal[4];
string club[4];
int skorPerClub[4];
for(int i = 0; i<4; i++){
skorPerClub[i] = 0;
club[i] = "";
selisihGoal[i] = 0;
}
int banyakClubYangDahMasuk = 0;
string Home, Away, random;
int SkorHome, SkorAway;
for(int i = 0; i<12; i++){
cin>>Home>>SkorHome>>random>>SkorAway>>Away;
int indexHome = 0, indexAway = 0;
for(int j = 0; j<4; j++){
if(Home == club[j]){
indexHome = j;
break;
}else if(j == 3 && Home != club[j]){
indexHome = banyakClubYangDahMasuk;
club[banyakClubYangDahMasuk] = Home;
banyakClubYangDahMasuk++;
}
}
for(int j = 0; j<4; j++){
if(Away == club[j]){
indexAway = j;
break;
}else if(j == 3 && Away != club[j]){
indexAway = banyakClubYangDahMasuk;
club[banyakClubYangDahMasuk] = Away;
banyakClubYangDahMasuk++;
}
}
if(SkorHome > SkorAway){
skorPerClub[indexHome] += 3;
selisihGoal[indexHome] += SkorHome-SkorAway;
selisihGoal[indexAway] += SkorAway-SkorHome;
}else if(SkorAway > SkorHome){
skorPerClub[indexAway] += 3;
selisihGoal[indexAway] += SkorAway-SkorHome;
selisihGoal[indexHome] += SkorHome-SkorAway;
}else{
skorPerClub[indexHome]++;
skorPerClub[indexAway]++;
}
}
for(int i = 0; i<3; i++){
for(int j = 0; j<3-i; j++){
if(skorPerClub[j] < skorPerClub[j+1]){
swap(skorPerClub[j], skorPerClub[j+1]);
swap(selisihGoal[j], selisihGoal[j+1]);
swap(club[j], club[j+1]);
}else if(skorPerClub[j] == skorPerClub[j+1] && selisihGoal[j] < selisihGoal[j+1]){
swap(skorPerClub[j], skorPerClub[j+1]);
swap(selisihGoal[j], selisihGoal[j+1]);
swap(club[j], club[j+1]);
}
}
}
cout<<club[0]<<" "<<club[1]<<endl;
}
}