QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#246789 | #5660. Simplified Genome Translation | billytngo | AC ✓ | 76ms | 40396kb | Java8 | 2.2kb | 2023-11-11 08:28:25 | 2023-11-11 08:28:27 |
Judging History
answer
import java.io.File;
import java.io.FileNotFoundException;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
private static Scanner sc;
private static Map<String,String> M;
public static void main(String[] args) throws FileNotFoundException {
// TODO Auto-generated method stub
sc = new Scanner(System.in);
int T = sc.nextInt();
M = new HashMap<String,String>();
M.put("UUU", "F");
M.put("UUC", "F");
M.put("UUA", "L");
M.put("UUG", "L");
M.put("CUU", "L");
M.put("CUC", "L");
M.put("CUA", "L");
M.put("CUG", "L");
M.put("AUU", "I");
M.put("AUC", "I");
M.put("AUA", "I");
M.put("AUG", "M");
M.put("GUU", "V");
M.put("GUC", "V");
M.put("GUA", "V");
M.put("GUG", "V");
M.put("UCU", "S");
M.put("UCC", "S");
M.put("UCA", "S");
M.put("UCG", "S");
M.put("AGU", "S");
M.put("AGC", "S");
M.put("CCU", "P");
M.put("CCC", "P");
M.put("CCA", "P");
M.put("CCG", "P");
M.put("ACU", "T");
M.put("ACC", "T");
M.put("ACA", "T");
M.put("ACG", "T");
M.put("GCU", "A");
M.put("GCC", "A");
M.put("GCA", "A");
M.put("GCG", "A");
M.put("UAU", "Y");
M.put("UAC", "Y");
M.put("CAU", "H");
M.put("CAC", "H");
M.put("CAA", "Q");
M.put("CAG", "Q");
M.put("AAU", "N");
M.put("AAC", "N");
M.put("AAA", "K");
M.put("AAG", "K");
M.put("GAU", "D");
M.put("GAC", "D");
M.put("GAA", "E");
M.put("GAG", "E");
M.put("UGU", "C");
M.put("UGC", "C");
M.put("UGG", "W");
M.put("CGU", "R");
M.put("CGC", "R");
M.put("CGA", "R");
M.put("CGG", "R");
M.put("AGA", "R");
M.put("AGG", "R");
M.put("GGU", "G");
M.put("GGC", "G");
M.put("GGA", "G");
M.put("GGG", "G");
M.put("UAA", "STOP");
M.put("UAG", "STOP");
M.put("UGA", "STOP");
for(int i=0;i<T;i++) {
process();
}
}
private static void process() {
// TODO Auto-generated method stub
String s = sc.next();
String ret = "";
for(int i=0;i<s.length();i+=3) {
String nuc = s.substring(i,i+3);
String o = M.get(nuc);
if(o.equals("STOP")) {
break;
}
ret += o;
}
System.out.println(ret);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 57ms
memory: 39644kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: 0
Accepted
time: 76ms
memory: 39568kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQREGLLIRSGLSCS NGSLLYHFTRCDT DASYKADEGLMFVLKDTGDYGSDYWQK SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANSSAWT FACST LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS II VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIYNSCYIY TRKLSFS ESDQC QNGIPKKAC PHTRRTLPPSV GI ATSNVCTSFHGAGASGRNVCIRGRDRPL AF NPFQVSRSLQPRS IHPGYLRTGGGFRSILSVTRDG...
result:
ok 50 lines
Test #3:
score: 0
Accepted
time: 66ms
memory: 40396kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQREGLLIRSGLSCS NGSLLYHFTRCDT DASYKADEGLMFVLKDTGDYGSDYWQK SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANSSAWT FACST LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS II VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIYNSCYIY TRKLSFS ESDQC QNGIPKKAC PHTRRTLPPSV GI ATSNVCTSFHGAGASGRNVCIRGRDRPL AF NPFQVSRSLQPRS IHPGYLRTGGGFRSILSVTRDG...
result:
ok 50 lines