Csu 1460: Kastenlauf

Source: Internet
Author: User

1460: KastenlaufTime Limit: 1 Sec Memory Limit: 128 MB
Submit: 90 Solved: 28
[Submit] [Status] [Web Board] Description

Input

Output

Sample Input
220 01000 01000 10002000 100020 01000 02000 10002000 2000
Sample Output
happysad
A. Drink once every 50 meters and bring up to 20 drinks on his body. As long as he can go to the store, he will make up for 20 drinks. Now we have n + 2 points, starting point, n stores, and endpoints.
#include
  
   #include
   
    #include
    
     using namespace std;typedef struct nnn{    int x,y;}NODE;int n;NODE node[105];int abs(int a){    return a>0?a:-a;}int bfs(){    queue
     
      q;    NODE p;    int vist[105]={0};    q.push(node[1]);    while(!q.empty())    {        p=q.front(); q.pop();        if(abs(p.x-node[n].x)+abs(p.y-node[n].y)<=1000)        return 1;        for(int i=2; i
      
       

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.