So, this problem's a bit tricky.
First, if you observe the sample input carefully, notice that the
leading spaces are trimmed. So, for example, if this the input is
then the AC output is
Next, it appears that the judge's input might not have trailing spaces - or if it does, then either trimming those trailing spaces or leaving them in the output gives AC. In my program, I trim the trailing spaces most of the time. So, for example, if the input's (with 4 trailing spaces)
Then my AC program produces the following output
Note that the trailing whitespaces are trimmed in the output.
However, in the following case (when there's a space in between the constant)
My AC program produces the following output (without trimming the trailing spaces - but always trimming the leading spaces)
Also, it wasn't clear to me from reading the problem statement what the AC output for the following input should be
The AC Output is
Finally,
junbin's test case helped me out. So here it is
without the underscores - and the AC output.
Input:
Code: Select all
k s jhsfdkkjsa df sadf s
dsfgh sdf gk dsf
2 2 3443 457 65
2e3e2e2
+e-2
+2-1
+2e-2
+2e+2
-2e-1-1
442
3465374657846358634563865923569548236458263458623562835682346582364582364
34653746578463_5863456386592356_95482364582634586235_62835682346582364582364
45643856
4353 e 546456
456456e345345
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576+
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576-
+462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576
462976592798713405193549823645926395628346589236458946e+4569223458726348563256238465872465876324576
-462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576
462976592798713405193549823645926395628346589236458946e-4569223458726348563256238465872465876324576
+462976592798713405193549823645926395628346589236458946e-4569223458726348563256238465872465876324576
-462976592798713405193549823645926395628346589236458946e+4569223458726348563256238465872465876324576
12e21
435e231e123e213
23e+355-14
+234+e234+E1234
3.2
459679346834596734956739476984396739476972394571936459823645863195629384658723653245235.37563286583645162847686587436587632475
457693476987495864364.5645634564564356e4563564564356543
457693476987495864364.5645634564564356e+4563564564356543
457693476987495864364.5645634564564356e-4563564564356543
+457693476987495864364.5645634564564356e4563564564356543
-457693476987495864364.5645634564564356e4563564564356543
457693476987495864364.+5645634564564356e4563564564356543
457693476987495864364.-5645634564564356e4563564564356543
*
AC Output:
Code: Select all
k s jhsfdkkjsa df sadf s is illegal.
dsfgh sdf gk dsf is illegal.
is illegal.
2 2 3443 457 65 is illegal.
2e3e2e2 is illegal.
+e-2 is illegal.
+2-1 is illegal.
+2e-2 is legal.
+2e+2 is legal.
-2e-1-1 is illegal.
442 is illegal.
3465374657846358634563865923569548236458263458623562835682346582364582364 is illegal.
34653746578463_5863456386592356_95482364582634586235_62835682346582364582364 is illegal.
45643856 is illegal.
4353 e 546456 is illegal.
456456e345345 is legal.
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576 is legal.
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576+ is illegal.
462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576- is illegal.
+462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576 is legal.
462976592798713405193549823645926395628346589236458946e+4569223458726348563256238465872465876324576 is legal.
_-462976592798713405193549823645926395628346589236458946e4569223458726348563256238465872465876324576 is illegal.
462976592798713405193549823645926395628346589236458946e-4569223458726348563256238465872465876324576 is legal.
+462976592798713405193549823645926395628346589236458946e-4569223458726348563256238465872465876324576 is legal.
-462976592798713405193549823645926395628346589236458946e+4569223458726348563256238465872465876324576 is legal.
12e21 is legal.
435e231e123e213 is illegal.
23e+355-14 is illegal.
+234+e234+E1234 is illegal.
3.2 is legal.
459679346834596734956739476984396739476972394571936459823645863195629384658723653245235.37563286583645162847686587436587632475 is legal.
457693476987495864364.5645634564564356e4563564564356543 is legal.
457693476987495864364.5645634564564356e+4563564564356543 is legal.
457693476987495864364.5645634564564356e-4563564564356543 is legal.
+457693476987495864364.5645634564564356e4563564564356543 is legal.
-457693476987495864364.5645634564564356e4563564564356543 is legal.
457693476987495864364.+5645634564564356e4563564564356543 is illegal.
457693476987495864364.-5645634564564356e4563564564356543 is illegal.