Editorial for Автобусна Екскурзия


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.
by: maya

Тестовете можете да видите тук.

Примерно решение на C++:

#include <iostream>
using namespace std;

int main()
{
    int w,h;
    cin>>w>>h;
    int n;
    cin>>n;
    int x,y,nom=0,b=0;
    for (int i=1; i<=n;i++)
    {
        cin>>x>>y;
        if ((x<w ||y<h)&& !b)
        {
            b=1;
            nom=i;
        }
    }
    if (b!=0) cout<<nom<<endl;
          else cout<<"No crash"<<endl;


    return 0;
}

Comments

There are no comments at the moment.