Submission #499492

# Submission time Handle Problem Language Result Execution time Memory
499492 2021-12-28T14:03:42 Z Ghazal_Dwai Ljeto (COCI21_ljeto) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
int a[105];
int b[105];
int t[105];
int main()
{
int n;
int team1=0,team2=0;
map<int,int> ans;
cin>>n;
for(int i=0;i<n;i++)
{
    cin>>a[i];
}
for(int i=0;i<n;i++){
    cin>>b[i];
}
for(int i=0;i<n;i++){
    cin>>t[i];
}
for(int i=0;i<n;i++){
for(auto u:ans){
    u.first=a[i];
    u.second=t[i];

    if(t[i+1]-t[i]<=10){
        if(a[i]<=4){
            team1+=150;
        }

        else{
            team2+=150;
        }
}
    else{
        if(a[i]<=4){
            team1+=100;
            }
        else{
            team2+=100;
        }

}
}
cout<<team1<<" "<<team2;


    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:24:12: error: assignment of read-only member 'std::pair<const int, int>::first'
   24 |     u.first=a[i];
      |     ~~~~~~~^~~~~
Main.cpp:50:1: error: expected '}' at end of input
   50 | }
      | ^
Main.cpp:7:1: note: to match this '{'
    7 | {
      | ^