QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#111772#5660. Simplified Genome Translationxaphoenix#AC ✓2ms3384kbC++172.2kb2023-06-08 17:43:352023-06-08 17:43:38

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-08 17:43:38]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3384kb
  • [2023-06-08 17:43:35]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define LC ch[k][0] 
#define RC ch[k][1]
#define IO cin.sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define rep(i,a,n) for (int i = a; i < n; i++)
#define repn(i,a,n) for (int i = a; i <= n; i++)
#define per(i,a,n) for (int i = n - 1; i >= a; i--)
#define pern(i,a,n) for (int i = n; i >= a; i--)

typedef long long LL;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;

const int N = 500010;
const int M = 610000;
const int mod = 1e9+7;
const int inf = (int)1e9;
const LL INF = (LL)1e18;
const double eps = 1e-9;

map<string, char> m;

void solve() {
	string s;
	cin >> s;
	int n = s.length();
	int i = 0;
	string ans = ""; 
	while (1) {
		if (i >= n) break;
		string cur = s.substr(i, 3);
		char ch = m[cur];
		if (ch == 'a') break; 
		ans += ch; i+= 3;
	}
	cout << ans << "\n";
}

int main()
{
	IO;
	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"] = 'a'; m["UAG"] = 'a'; m["UGA"] = 'a'; 
	int T;
	cin >> T;
	repn(i, 1, T) solve();
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3320kb

input:

5
UUUUAACACUUUAUCACUUAACACCAC
CAAAAUAUGAAAAAU
AUGUACUUUGCGUUUCACUAA
UUGCACUACUAC
UACGUGGGUAUC

output:

F
QNMKN
MYFAFH
LHYY
YVGI

result:

ok 5 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3324kb

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: 2ms
memory: 3384kb

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