MODULUS2 - BF_MODULUS
See also http://www.spoj.com/problems/PROBLEM1/
Problem
Given an integer n print all the possibilities of a%n.
Input
The first line consists of an integer t, the number of test cases followed by t lines containing an integer n.
Output
For each test case print all the possibilities of a%n in descending order separated by a single space. After each test case print a new line character. If there are no possibilities print "NOT POSSIBLE".
Input specifications:
0<t<=100
0<=N<=100
Time limit: 1 second
Example
Sample Input
2
1
2
Sample Output
0
1 0
hide comments
(Tjandra Satria Gunawan)(曾毅昆):
2013-05-27 03:59:39
@Mitch Schwartz: Yes, I changed all whitespace to '\n' and got AC it save 10 Bytes... And it's true that this problem is not using exatct judge, thanks.. |
|
Mitch Schwartz:
2013-05-27 03:59:39
@Tjandra: I resubmitted my last code to see if the judge had changed. It can't be exact judge according to my submission... If you take your AC code and add a single "." to print extra whitespaces, does it become WA? It should stay AC. Last edit: 2013-04-13 17:46:13 |
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-05-27 03:59:39
@Mitch Schwartz: If this problem not using exact judge, my old submission (ID: 7366784) should AC.. it print too many space (line end with 'space''\n'), and I fix this code (remove the space) and got AC.. If it's true that this problem isn't using exact judge, I still don't know why my old code (ID: 7366784) getting WA.. It run perfectly both on ideone and my computer.. strange.. |
|
Mitch Schwartz:
2013-05-27 03:59:39
@Tjandra: Exact judge isn't used. |
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-05-27 03:59:39
this problem seems using exact judge.. |
|
Mostafa 36a2:
2013-05-27 03:59:39
@ Aditya Pande tes you're right no '\n' after last line ... it's happend to me too :) |
|
Aditya Pande:
2013-05-27 03:59:39
why does my submission give me TLE....?
|
|
Mitch Schwartz:
2013-05-27 03:59:39
I might as well disclose that my best solution relies on input weakness: N=100 does not appear in the input, and two N=0 in a row also do not appear. I got 300 bytes for general solution but after that only tried to optimise code that relies on weak test data, so I'm not sure what the 300 would turn into trying to optimise for strong data. I think the problem setter would be pretty responsive if there is demand to make the test data stronger; I have his email address from communication on some other problems, if he doesn't respond to comments. Or, maybe the problem description could be changed instead.
|
|
Mitch Schwartz:
2013-05-27 03:59:39
@Jitesh: In what way did it fail? If you got NZEC with stderr message like "bff: out of memory (294489024)", it could be the bug described here:
|
|
Jitesh:
2013-05-27 03:59:39
@Mitch Schwartz:
|
Added by: | cegprakash |
Date: | 2011-03-18 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | BF |