>>7quadratic time solution is the correct one, with a slight modification: output each language wich compiles with no errors. this will detect polyglot programs and intentionally obfuscated (or
VALID PERL) code that doesn't look like the language it's written in. it will also not be fooled by nonsense which uses tokens from a language but isn't valid code.