All submissions for this problem are available.
Zoom has corrupted the flash's numeral database. The database had numbers stored only in roman numerals and zoom added invalid numerals. Now the flash needs your help in eliminating the invalid roman numerals from the valid ones.
I = 1, V=5, X=10, L=50, C=100, D=500, M=1,000
The first line of the input contains an integer T denoting the number of test cases. The following lines contain the test cases
Each test case contains a single string N containing the roman numeral.
For each test case, output True if it is a valid roman numeral and False if it is an invalid roman numeral.Please note that True and False are CASE SENSITIVE.
- 1 ≤ T ≤ 10^9
- 1 ≤ len(N) ≤ 20
1 DCCCXC Output:
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.