Submission #1346557

#TimeUsernameProblemLanguageResultExecution timeMemory
1346557MrAndriaSprinklers (CEOI24_sprinklers)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ff first;
#define ss second
#define pb push_back
#define int long long
int n,m,x,curr,ans,a[1000005];
signed main(){
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=1;i<=m;i++){
        cin>>b[i];
        
    }
    if(b[n]<=a[1]){
        cout<<a[1]-b[1]<<endl;
        cout<<"L"<<endl;
    }else{
        if(b[1]>=a[1]){
            cout<<b[n]-a[1]<<endl;
            cout<<"R"<<endl;
        }else{
            cout<<-1<<endl;
        }
    }

}

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:14:14: error: 'b' was not declared in this scope
   14 |         cin>>b[i];
      |              ^
Main.cpp:17:8: error: 'b' was not declared in this scope
   17 |     if(b[n]<=a[1]){
      |        ^