QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#89488#5660. Simplified Genome Translationphtniit#AC ✓3ms3500kbC++112.7kb2023-03-20 10:37:522023-03-20 10:37:54

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-20 10:37:54]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3500kb
  • [2023-03-20 10:37:52]
  • 提交

answer

#include <bits/stdc++.h>
//#pragma GCC optimize("Ofast","-funroll-loops")
//#pragma GCC target("sse4.1","sse4.2","ssse3","sse3","sse2","sse","avx2","avx","popcnt","tune=native")

using namespace std;

typedef long double ldb;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int, int> pii;

// priority_queue<int, vector<int>, greater<int>> minq;
// ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// fflush(stdout);

const int inf = 1000000007;
const i64 prm = 998244353;
const i64 inf2 = ((i64)inf) * inf;
const i64 bone = 1;
const int maxn = 500010;

inline int read(){
  int x=0,f=0; char ch=getchar();
  while(!isdigit(ch)) f|=(ch==45),ch=getchar();
  while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
  return f?-x:x;
}

/*
   1. 请再三确认题意
   2. 对于复杂的数据结构+贪心/结论/计数题,可以考虑先写暴力,确认想法正确,再逐步优化
 */

map<string, string> M;
void once() {
  string s;
  cin >> s;
  int sz = s.size();
  for (int i = 0; i < sz; i += 3) {
    string t = M[s.substr(i, 3)];
    if (t == "$") {
      break;
    }
    putchar(t[0]);
  }
  puts("");
}

/*
   F UUU UUC
   L UUA UUG CUU CUC CUA CUG
   I AUU AUC AUA
   M AUG
   V GUU GUC GUA GUG
   S UCU UCC UCA UCG AGU AGC
   P CCU CCC CCA CCG
   T ACU ACC ACA ACG
   A GCU GCC GCA GCG
   Y UAU UAC
   H CAU CAC
   Q CAA CAG
   N AAU AAC
   K AAA AAG
   D GAU GAC
   E GAA GAG
   C UGU UGC
   W UGG
   R CGU CGC CGA CGG AGA AGG
   G GGU GGC GGA GGG
   STOP UAA UAG UGA

 */

int main() {
  M["UUU"]="F";
  M["UUC"]="F";
  M["UUA"]="L";
  M["UUG"]="L";
  M["CUU"]="L";
  M["CUC"]="L";
  M["CUA"]="L";
  M["CUG"]="L";
  M["AUU"]="I";
  M["AUC"]="I";
  M["AUA"]="I";
  M["AUG"]="M";
  M["GUU"]="V";
  M["GUC"]="V";
  M["GUA"]="V";
  M["GUG"]="V";
  M["UCU"]="S";
  M["UCC"]="S";
  M["UCA"]="S";
  M["UCG"]="S";
  M["AGU"]="S";
  M["AGC"]="S";
  M["CCU"]="P";
  M["CCC"]="P";
  M["CCA"]="P";
  M["CCG"]="P";
  M["ACU"]="T";
  M["ACC"]="T";
  M["ACA"]="T";
  M["ACG"]="T";
  M["GCU"]="A";
  M["GCC"]="A";
  M["GCA"]="A";
  M["GCG"]="A";
  M["UAU"]="Y";
  M["UAC"]="Y";
  M["CAU"]="H";
  M["CAC"]="H";
  M["CAA"]="Q";
  M["CAG"]="Q";
  M["AAU"]="N";
  M["AAC"]="N";
  M["AAA"]="K";
  M["AAG"]="K";
  M["GAU"]="D";
  M["GAC"]="D";
  M["GAA"]="E";
  M["GAG"]="E";
  M["UGU"]="C";
  M["UGC"]="C";
  M["UGG"]="W";
  M["CGU"]="R";
  M["CGC"]="R";
  M["CGA"]="R";
  M["CGG"]="R";
  M["AGA"]="R";
  M["AGG"]="R";
  M["GGU"]="G";
  M["GGC"]="G";
  M["GGA"]="G";
  M["GGG"]="G";
  M["UAA"]="$";
  M["UAG"]="$";
  M["UGA"]="$";
  int tes = 1;
  tes = read();
  while (tes--) {
    once();
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3400kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 3ms
memory: 3360kb

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: 3ms
memory: 3500kb

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