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:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.