WILLITST - Will it ever stop
When Bob was in library in University of Warsaw he saw on one of facades caption :"Will it ever stop?" and below some mysterious code:
while n > 1 if n mod 2 = 0 then n := n / 2 else n := 3 * n + 3
Help him finding it out !
Input
In first line one number n ≤ 1014.
Output
Print "TAK" if program will stop, otherwise print "NIE"
Example
Input: 4 Output: TAK
hide comments
|
kevinmitnick42:
2021-11-18 15:43:50
y'all wildin |
|
upsehu:
2021-05-30 13:10:04
make sure to put NIE not NE |
|
apurv22:
2021-05-27 10:04:42
cant get a more simpler problem on spoj |
|
yasser1110:
2021-02-24 09:49:34
simple but tricky question. |
|
marat0210:
2021-02-01 19:05:11
@sarveshjain967. Well I used 47 loops. Which is log2(10^14). That was enough for AC. |
|
anurag_mishra:
2020-11-27 18:56:20
__builtin_popcount = int
|
|
crawler_123:
2020-08-04 14:22:48
Don't use __builtin_popcount here. I repeat don't use it. |
|
imsrvstv:
2020-06-28 19:55:07
Btw I got 4 wrong answers because I was printing "NIL" instead of "NIE" keep in mind to not do that mistake too. Last edit: 2022-08-09 22:11:46 |
|
sarveshjain967:
2020-06-24 21:22:23
Barely took me 4 mins
|
|
agrawaladitya:
2020-06-13 13:33:18
So I was printing "YAK" instead of "TAK" and it cost me 6 WAs.
|
Added by: | Krzysztof Lewko |
Date: | 2011-11-09 |
Time limit: | 0.906s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | AMPPZ 2011 |