MKLAR10  Kids’ Wishes
English  Vietnamese 
Input
Each test case is given using several lines. The ﬁrst line contains two integers K and W representing respectively the number of kids (3 ≤ K ≤ 10^9) and the number of wishes (0 ≤ W ≤ 10^5). Kids are identiﬁed with numbers between 1 and K. Each of the next W lines describes a diﬀerent wish using two distinct integers A and B (1 ≤ A,B ≤ K); these values represent that kid A wishes to sit down next to kid B. Each kid has at most two wishes.
The last test case is followed by a line containing two zeros.
Output
For each test case output a single line containing an uppercase ‘Y’ if it is possible to arrange a circle in such a way that all kids’ wishes are satisﬁed, or an uppercase ‘N’ otherwise.
Sample
input
4 3 2 3 1 3 2 1 1000000000 0 3 6 3 2 2 1 1 2 1 3 2 3 3 1 0 0
output
N Y Y
hide comments
:
20120904 01:36:51
My solution is running correct on the official testcases is there anything special about output? 

~:
20111119 08:45:31
how any body can get ac IN TEXT !!...is judge's testcaes are known to him ...:P 

Roberto:
20111012 14:42:54
Why do I get TLE if in UVA Judge I get WA ¿? 

Dante is not a Geek:
20110704 14:10:44
SPOJ has suddenly stopped supporting C++0x? @_@ Last edit: 20110705 04:45:30 

Crazzyy:
20110122 20:13:09
How can this be AC in text ?? 

PRATEEK KHURANA:
20110114 13:25:01
well, my solution is just a modification of the text file in c, when i saw there are AC text solutions Last edit: 20110114 14:40:38 

cjtoribio:
20101110 22:46:53
THANXS for rejudge and correction i was getting TLE and ended being first. Good prob though. 

Shaka Shadows:
20101109 19:38:08
Test data files have been corrected and all the solutions have been rejudged. We sorry about the mistakes. 

Kinan Sarmini:
20101109 19:27:47
Is there anything wrong with test cases? I ran my solution on official tests, and running time is 1.5 second but I'm getting TLE :/ 

.:: Pratik ::.:
20101109 19:27:47
Input doesnt end with 0 0

Added by:  ~!(*(@*!@^& 
Date:  20101105 
Time limit:  0.132s0.661s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  ACM ICPC2010 – Latin American Regional 