Submission #699391

#TimeUsernameProblemLanguageResultExecution timeMemory
699391Mo7amed_HossamArt Exhibition (JOI18_art)C++17
Compilation error
0 ms0 KiB
/** created by Mohamed hossam #### #### ## ## ## ## ## ## ##### ## ## ###### ## ## ## ## ## ## ## ####### ############## ## ## ######## ## ###### ## ## ## ####### ############## ######### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ### ### ##### ## ## ## ## ## ####### ########*/#include <bits/stdc++.h>#define ll long long#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std;ll n; int main(){ fast; cin>>n; pair<ll,ll>a[n+1]; for(ll i=0; i<n; i++) { cin>>a[i].first>>a[i].second; } sort(a,a+n); ll k=-1e15; for(ll i=0; i<n; i++) { ll b=a[i]. second; for(ll j=i+1; j<n; j++) { b+=a[j].second; k=max(k,b-(a[j]. first-a[i]. first)); } }cout<<k; return 0;}

Compilation message (stderr)

art.cpp:1:578: warning: extra tokens at end of #include directive
    1 | /** created by Mohamed hossam ####        ####                  ##                                                ## ## ##      ## ##      #####       ##         ##                  ######             ## ##  ##    ##  ##    ##     ##     #######    ##############     ##    ##      ######## ##   ######   ##   ##       ##    #######    ##############    #########     ##     ## ##            ##    ##     ##     ##   ##    ##    ##    ##     ##           ##     ## ###          ###      #####       ##   ##    ##    ##    ##      #######      ########*/#include <bits/stdc++.h>#define ll long long#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); using namespace std;ll n; int main(){    fast;    cin>>n;    pair<ll,ll>a[n+1];    for(ll i=0; i<n; i++)    {        cin>>a[i].first>>a[i].second;    }    sort(a,a+n);    ll k=-1e15;    for(ll i=0; i<n; i++)    {        ll b=a[i]. second;        for(ll j=i+1; j<n; j++)        {            b+=a[j].second;            k=max(k,b-(a[j]. first-a[i]. first));        }    }cout<<k;    return 0;}
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status