+ 4

Hidden test case

https://www.sololearn.com/coach/41?ref=app This challenge doesnot show the test cases. It say that the testcase is hidden. I want to know how to open it

26th Dec 2019, 9:50 AM
nguyễn long
nguyễn long - avatar
12 Respostas
+ 1
Good Luck out there misses exclamation mark.
26th Dec 2019, 10:29 AM
HonFu
HonFu - avatar
+ 3
All of them show 2 test inputs, and hide 3 more. It is done this way so you cannot use input specific tricks. You cannot see the hidden ones.
26th Dec 2019, 9:55 AM
Fernando Pozzetti
Fernando Pozzetti - avatar
+ 2
You can't. They want you to write the code according to their specifications; if their secret tests fail, you're supposed to figure out the bug with your own tests.
26th Dec 2019, 9:55 AM
HonFu
HonFu - avatar
+ 2
Thank. I use cin to input an interger then use if command to compare it with 5 and 10 to get different outputs arcording to the challenge. I think it is not tricky way when doing that, right ?
26th Dec 2019, 10:10 AM
nguyễn long
nguyễn long - avatar
+ 1
Well, sometimes there are small problems which we are not aware of. Do you want to show us your solution so we can take a look?
26th Dec 2019, 10:23 AM
HonFu
HonFu - avatar
+ 1
Thank alot for your help. Below is my code. I am learning CPP #include <iostream> #include <string> using namespace std; int main() { int crim; string help; cin >> crim; if(crim <5 && crim >=0){ help ="I got this!"; } else if(crim >=5 && crim <=10){ help = "Help me Batman"; } else{ help = "Good Luck out there" ; } cout << help; return 0; }
26th Dec 2019, 10:25 AM
nguyễn long
nguyễn long - avatar
0
Thank you very much !. You 're right, i just realized that
26th Dec 2019, 10:31 AM
nguyễn long
nguyễn long - avatar
0
My code fails to qualify for test cases 3 and 5. I don't think there is any bug in my program. Someone please help ! My code solution for Military Time problem import java.util.*; import java.lang.*; import java.io.*; class MT { public static void main (String[] args) throws java.lang.Exception { Scanner sp = new Scanner(System.in); String mt = null; int i = 0; String m = sp.nextLine().toLowerCase(); if(m.indexOf(" am")!=-1) { if(Integer.parseInt(m.substring(0,m.indexOf(":")))==12) { mt ="00"+m.substring(m.indexOf(":"),m.indexOf(" ")); } else mt=m.substring(0,m.indexOf(" ")); } if(m.indexOf(" pm")!=-1) { if(Integer.parseInt(m.substring(0,m.indexOf(":")))==12) mt = m.substring(0,m.indexOf(" ")); else mt=Integer.toString(Integer.parseInt(m.substring(0,m.indexOf(":")))+12)+m.substring(m.indexOf(":"),m.indexOf(" ")); } try {System.out.println(mt);} catch(Exception e){} } }
29th Apr 2020, 9:27 AM
Wolf Master
Wolf Master - avatar
0
For an algorithm(steps in solving the problem ) to be correct, it must produce the same output for any given input. If all test cases were shown it will simply make us write the code with respect to the inputs shown not considering other inputs.
31st Jul 2020, 9:29 AM
BRYAND CHE
BRYAND CHE - avatar
0
in decimal to binary conversion test case 4 are hidden so its not showing what i do
15th Mar 2021, 6:22 AM
Nikesh verma
Nikesh verma - avatar
0
Yo only one of my testcase is not passing help me #include <iostream> using namespace std; int main() { int ages[5]; for (int i = 0; i < 5; ++i) { cin >> ages[i]; } float price; int i; float smallest = ages[0]; for (i = 0; i < 4; i++) { if (ages[i] < smallest) { smallest = ages[i]; } } price = 50*(1 - (smallest/100)); cout << price; return 0; }
24th May 2022, 1:42 AM
Rustic Dude
Rustic Dude - avatar
0
n = int(input()) #your code goes here nums = list(range(5,n,5)) for x in nums: print(x) this code run properly but test case 5 shows not right how to solve it
22nd Jul 2022, 6:59 AM
Amit Kumar
Amit Kumar - avatar