Submission #1176953

#TimeUsernameProblemLanguageResultExecution timeMemory
1176953maryamrLjeto (COCI21_ljeto)C++20
Compilation error
0 ms0 KiB
using namespace std;
#define int long long
signed main()
{
    int n;
    cin>>n;
    int t[n], a[n], c[n];
    int p=0, b=0;
    for(int i=0; i<n; i++)
    {
        cin>>t[i]>>a[i]>>c[i];
        if(a[i]<=4)
        {
            p+=100;
            if(i>0)
            {
                if( a[i]==a[i-1] and t[i]-t[i-1]<=10)
                {
                    p+=50;
                }
            }
        }
        else
        {
            b+=100;
            if(i>0)
            {
                if( a[i]==a[i-1] and t[i]-t[i-1]<=10)
                {
                    b+=50;
                }
            }
        }
    }
    cout<<p<<" "<<b<<endl;
}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
Main.cpp:1:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | using namespace std;
Main.cpp:35:5: error: 'cout' was not declared in this scope
   35 |     cout<<p<<" "<<b<<endl;
      |     ^~~~
Main.cpp:35:5: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Main.cpp:35:22: error: 'endl' was not declared in this scope
   35 |     cout<<p<<" "<<b<<endl;
      |                      ^~~~
Main.cpp:1:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
  +++ |+#include <ostream>
    1 | using namespace std;