Bzoj 4143 the Lawyer

Source: Internet
Author: User

This problem looks very scary, but in fact, you will find that it does not have any technical content, do this problem in fact to consider is the earliest end of the day and the beginning of the start of the first time, if the end time is earlier than the start time, then OK on the two, otherwise the output no solution, to note that If you want to separate every day when you pass in, remember to mark the number of each field.

The code is as follows:

#include <cstdlib>#include<cstdio>#include<iostream>using namespacestd;Long Long intI_day,i_huiyi,temp_1,temp_2,temp_3;Long Long inti_hui[ +][500000][3];Long Long inti_nob[ +];Long Long inti_min,nob_1,i_max=80000000, nob_2;intMain () {CIN>>i_huiyi;cin>>I_day;  for(intI=0; i<i_huiyi;i++) {cin>>temp_1;cin>>temp_2;cin>>Temp_3; i_hui[temp_3][i_nob[temp_3]][0]=temp_1; i_hui[temp_3][i_nob[temp_3]][1]=temp_2; i_hui[temp_3][i_nob[temp_3]][2]=i+1; I_nob[temp_3]++; }     for(intI=1; i<=i_day;i++)    {         for(intm=0; m<i_nob[i];m++)        {            if(i_hui[i][m][0]>i_min) {I_min=i_hui[i][m][0]; Nob_1=i_hui[i][m][2]; }            if(i_hui[i][m][1]<I_max) {I_max=i_hui[i][m][1]; Nob_2=i_hui[i][m][2]; }        }        if(i_min>I_max) {cout<<"TAK"<<" "<<nob_1<<" "<<nob_2<<Endl; I_min=0; i_max=80000000; }        Else{cout<<"NIE"<<Endl; I_min=0; i_max=80000000; }    }         return 0;}
Hope my blog can help you, thank you.

Bzoj 4143 the Lawyer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.