QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#133176 | #5660. Simplified Genome Translation | tselmegkh# | WA | 1ms | 3512kb | C++20 | 2.2kb | 2023-08-01 16:56:02 | 2023-08-01 16:56:04 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iomanip>
using namespace std;
const int N = 2e5 + 5, inf = 1e9;
#define pb push_back
#define mp make_pair
#define ll long long
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
#define sz(x) (int)x.size()
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
map<string, char> d;
void solve(){
string s;
cin >> s;
int n = sz(s);
for(int i = 0; i < sz(s) - 2; i += 3){
string t = s.substr(i, 3);
if(d.find(t) != d.end()){
cout << d[t];
} else {
break;
}
}
cout << '\n';
}
void f(string s, char c){
d[s] = c;
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int t = 1;
cin >> t;
f("UUU", 'F');
f("UUC", 'F');
f("UUA", 'L');
f("UUG", 'L');
f("CUU", 'L');
f("CUC", 'L');
f("CUA", 'L');
f("CUG", 'L');
f("AUU", 'I');
f("AUC", 'I');
f("AUA", 'I');
f("AUG", 'M');
f("GUU", 'V');
f("GUC", 'V');
f("GUA", 'V');
f("GUG", 'V');
f("UCU", 'S');
f("UCC", 'S');
f("UCA", 'S');
f("UCG", 'S');
f("AGU", 'S');
f("AGC", 'S');
f("CCU", 'P');
f("CCC", 'P');
f("CCA", 'P');
f("CCG", 'P');
f("ACU", 'T');
f("ACC", 'T');
f("ACA", 'T');
f("ACG", 'T');
f("GCU", 'A');
f("GCC", 'A');
f("GCA", 'A');
f("GCG", 'A');
f("UAU", 'Y');
f("UAC", 'Y');
f("CAU", 'H');
f("CAC", 'H');
f("CAA", 'Q');
f("CAG", 'Q');
f("AAU", 'N');
f("AAG", 'N');
f("AAA", 'K');
f("AAG", 'K');
f("GAU", 'D');
f("GAC", 'D');
f("GAA", 'E');
f("GAG", 'E');
f("UGU", 'C');
f("UGC", 'C');
f("UGG", 'W');
f("CGU", 'R');
f("CGC", 'R');
f("CGA", 'R');
f("CGG", 'R');
f("AGA", 'R');
f("AGG", 'R');
f("GGU", 'G');
f("GGC", 'G');
f("GGA", 'G');
f("GGG", 'G');
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3472kb
input:
5 UUUUAACACUUUAUCACUUAACACCAC CAAAAUAUGAAAAAU AUGUACUUUGCGUUUCACUAA UUGCACUACUAC UACGUGGGUAUC
output:
F QNMKN MYFAFH LHYY YVGI
result:
ok 5 lines
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3512kb
input:
50 GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...
output:
GQREGLLIRSGLSCS NGSLLYHFTRCDT DASYKADEGLMFVLKDTGDYGSDYWQK SRKVLVDRISEPLVVAYLEGTDVDGANIGSKFDGANSSAWT FACST LT II VLLRAARISCTFIHCRCSRRGFGPLSPCPPRPLAGVGSMIY TRKLSFS ESDQC Q PHTRRTLPPSV GI ATS AF IHPGYLRTGGGFRSILSVTRDGLRRHRTRYECSTRDNALQGQRELQSHTSLLIIYYCVYCRTGIGR DITYYELRTFSDLISLSKF LEF TKTPGFGQLYKLPDTI...
result:
wrong answer 6th lines differ - expected: 'LTNARTSFYALRFKDACKYTCKSLFELFSNRGQFS', found: 'LT'