11498 - Division of Nlogonia

All about problems in Volume 114. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Xenon Kfr
New poster
Posts: 13
Joined: Tue Nov 18, 2014 1:14 am

Re: 11498 - Division of Nlogonia

Post by Xenon Kfr »

what is wrong ? why wa ?

Code: Select all

#include<stdio.h>
int main()
{
    long long t,m,n,i,a,b;
    while((scanf("%lld",&t)))
    {
        if(t==0)
            break;
        scanf("%lld%lld",&m,&n);
        for(i=0;i<t;i++)
        {
            scanf("%lld%lld",&a,&b);
            if(a==m || b==n)
                printf("divisa\n");
            else if(a>m && b>n)
                printf("NE\n");
            else if(a<m && b<n)
                printf("SO\n");
            else if(a>m && b<m)
                printf("SE\n");
            else if(a<m && b>m)
                printf("NO\n");

        }
    }
    return 0;
}
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11498 - Division of Nlogonia

Post by lighted »

Input

Code: Select all

1
1 4
5 2

1
4 1
2 3

0
Acc Output

Code: Select all

SE
NO
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
hemagoku
New poster
Posts: 1
Joined: Mon Mar 23, 2015 8:53 pm

Re: 11498 - Division of Nlogonia

Post by hemagoku »

why does the following give a compiler error ? it is created in C++ on VS.
http://codepad.org/k8pYHeyu
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11498 - Division of Nlogonia

Post by brianfry713 »

#include <stdio.h>
Check input and AC output for thousands of problems on uDebug!
jafor.ruetcse13
New poster
Posts: 1
Joined: Wed Jun 10, 2015 12:13 pm

Re: 11498 - Division of Nlogonia

Post by jafor.ruetcse13 »

why the following code show time limit exist..........

Code: Select all

#include<stdio.h>
int main()
{
    int k,c1,c2,x,y,i;
    while(scanf("%d\n",&k)!=0)
    {
        scanf("%d%d\n",&c1,&c2);
        for(i=0;i<k;i++){
            scanf("%d%d\n",&x,&y);

             if(x>c1 && y>c2)
                printf("NE\n");
           else if(x<c1 && y>c2)
                printf("NO\n");
           else if(x<c1 && y<c2)
                printf("SO\n");
            else if(x>c1 && y<c2)
                printf("SE\n");
              else
                printf("divisa\n");
        }
    }
    return 0;

}
please anyone help me
Last edited by brianfry713 on Fri Jun 19, 2015 7:04 am, edited 1 time in total.
Reason: Added code blocks
Post Reply

Return to “Volume 114 (11400-11499)”