Submission #624410

# Submission time Handle Problem Language Result Execution time Memory
624410 2022-08-08T08:22:06 Z andrei_boaca Tram (CEOI13_tram) C++14
0 / 100
1 ms 212 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
ll n,m;
bool have[150005][3];
set<ll> s;
pii where[30005];
ll dist(ll a, ll b, ll c, ll d)
{
    return (a-c)*(a-c)+(b-d)*(b-d);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>m;
    int cur=0;
    have[0][1]=have[0][2]=1;
    have[n+1][1]=have[n+1][2]=1;
    /*while(m--)
    {
        cur++;
        char c;
        cin>>c;
        if(c=='E')
        {
            if(s.empty())
            {
                cout<<1<<' '<<1<<'\n';
                s.insert(1);
                have[1][1]=1;
                where[cur]={1,1};
                continue;
            }
            vector<int> v;
            v.push_back(0);
            for(int i:s)
                v.push_back(i);
            v.push_back(n+1);
            ll dmax=0;
            pii who;
            for(int i=1;i<v.size();i++)
            {
                int st=v[i-1];
                int dr=v[i];
                int mij=(st+dr)/2;
                for(int a=mij;a<=mij+1;a++)
                    if(a>=st&&a<=dr&&a>=1&&a<=n)
                        for(int j=1;j<=2;j++)
                            if(!have[a][j])
                            {
                                ll minim=1e18;
                                for(int k=1;k<=2;k++)
                                {
                                    if(have[st][k]&&st>0)
                                        minim=min(minim,dist(st,k,a,j));
                                    if(have[dr][k]&&dr<=n)
                                        minim=min(minim,dist(dr,k,a,j));
                                }
                                if(minim>dmax)
                                {
                                    dmax=minim;
                                    who={a,j};
                                }
                            }
                for(int a=st;a<=st+1;a++)
                    if(a>=st&&a<=dr&&a>=1&&a<=n)
                        for(int j=1;j<=2;j++)
                            if(!have[a][j])
                            {
                                ll minim=1e18;
                                for(int k=1;k<=2;k++)
                                {
                                    if(have[st][k]&&st>0)
                                        minim=min(minim,dist(st,k,a,j));
                                    if(have[dr][k]&&dr<=n)
                                        minim=min(minim,dist(dr,k,a,j));
                                }
                                if(minim>dmax)
                                {
                                    dmax=minim;
                                    who={a,j};
                                }
                            }
                for(int a=dr-1;a<=dr;a++)
                    if(a>=st&&a<=dr&&a>=1&&a<=n)
                        for(int j=1;j<=2;j++)
                            if(!have[a][j])
                            {
                                ll minim=1e18;
                                for(int k=1;k<=2;k++)
                                {
                                    if(have[st][k]&&st>0)
                                        minim=min(minim,dist(st,k,a,j));
                                    if(have[dr][k]&&dr<=n)
                                        minim=min(minim,dist(dr,k,a,j));
                                }
                                if(minim>dmax)
                                {
                                    dmax=minim;
                                    who={a,j};
                                }
                            }
            }
            cout<<who.first<<' '<<who.second<<'\n';
            have[who.first][who.second]=1;
            s.insert(who.first);
            where[cur]=who;
        }
        else
        {
            int p;
            cin>>p;
            int lin=where[p].first,col=where[p].second;
            have[lin][col]=0;
            if(have[lin][1]+have[lin][2]==0)
                s.erase(lin);
        }
    }*/
    int x=0;
    for(int i=1;i<=m;i++)
        for(int j=1;j<=m;j++)
            x++;
    return 0;
}

Compilation message

tram.cpp: In function 'int main()':
tram.cpp:19:9: warning: unused variable 'cur' [-Wunused-variable]
   19 |     int cur=0;
      |         ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -