+ 2

Please give me a solution...why gets compilation error in online judge..????

show the message ""Can\u0027t compile file: program.c:1:19: fatal error: iostream: No such file or directory compilation terminated. " when submit the programme... ## programme..## #include<iostream> using namespace std; #include<map> map<string,int>mp,nmp; string name[1002]; int score[1002]; int main() { int n,s; string winner_name; cin>>n; //This section is for first map. for(int i=0;i<n;i++) { cin>>winner_name>>s; name[i] =winner_name; score[i] = s; if(mp.find(winner_name)!=mp.end()) { mp[winner_name]+=s; } else{ mp[winner_name] = s; } } //This section is for select maximum points long long maxi=-1001; for(map<string,int>::iterator it=mp.begin();it!=mp.end();++it) { if(maxi<it->second) { maxi=it->second; } } for(int i=0;i<n;i++) { if(nmp.find(name[i])!=nmp.end()) { nmp[name[i]]+=score[i]; } else { nmp[name[i]]=score[i]; } if(maxi<=nmp[name[i]] and mp[name[i]]==maxi) { cout<<name[i]<<endl; return 0; } } return 0; }

19th Nov 2017, 1:08 AM
Sabbir Hossain
Sabbir Hossain - avatar
0 Respuestas