QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#123995#5660. Simplified Genome TranslationnicolasalbaWA 1ms3548kbC++142.8kb2023-07-14 02:38:302023-07-14 02:38:30

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-14 02:38:30]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3548kb
  • [2023-07-14 02:38:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define sortt(x) sort(all(x))
#define sq(a) ((a) * (a))
 
#define each(x, xs)  for (auto &x : (xs))
#define rep(i, be, en) for (__typeof(en) i = (be) - ((be) > (en)); i != (en) - ((be) > (en)); i += 1 - 2 * ((be) > (en)))
#define FOR(i, a, b) for (ll (i) = (a); (i) < (b); (i)++)
 
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using ti = tuple<long long, long long, long long>;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvl = vector<vl>;
using vpl = vector<pl>;
template<class T> using pql = priority_queue<T,vector<T>,greater<T>>;
template<class T> using pqg = priority_queue<T>;
 
// >>>>>>>>>> debugging >>>>>>>>>>
#ifdef NICO_LOCAL
    #include "/home/fundacion/templates/debug.h"
    #define LINE cerr << "-------------------" << endl;
#else
    #define deb(x...)
    #define LINE
#endif
// <<<<<<<<<< debugging <<<<<<<<<<
 
void test_case();

 
const ll INF = INT64_MAX;
const int inf = INT32_MAX;
const ld PI = acos(-1);
const int MOD = 1e9 + 7;
const int DX[4]{1,0,-1,0}, DY[4]{0,1,0,-1};
 
int testId;

void init();

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    init();
    int T;
    T = 1;
    cin >> T;
    rep (t, 0, T) { testId++; test_case(); }
 
    return 0;
}

map<string, vector<string>> m;
map<string, string> f;
void init() {

    m["F"] = { "UUU", "UUC" };
    m["L"] = { "UUA", "UUG", "CUU", "CUC", "CUA", "CUG"};
    m["I"] = { "AUU", "AUC", "AUA"};
    m["M"] = { "AUG"};
    m["V"] = { "GUU", "GUC" "GUA", "GUG"};
    m["S"] = { "UCU", "UCC" "UCA", "UCG", "AGU", "AGC"};
    m["P"] = { "CCU", "CCC" "CCA", "CCG"};
    m["T"] = { "ACU", "ACC" "ACA", "ACG"};
    m["A"] = { "GCU", "GCC" "GCA", "GCG"};
    m["Y"] = { "UAU", "UAC"};
    m["H"] = { "CAU", "CAC"};
    m["Q"] = { "CAA", "CAG"};
    m["N"] = { "AAU", "AAC"};
    m["K"] = { "AAA", "AAG"};
    m["D"] = { "GAU", "GAC"};
    m["E"] = { "GAA", "GAG"};
    m["C"] = { "UGU", "UGC"};
    m["W"] = { "UGG"};
    m["R"] = { "CGU", "CGC", "CGA", "CGG", "AGA", "AGG"};
    m["G"] = { "GGU", "GGC", "GGA", "GGG"};
    
    for (auto & x : m) {
        for (auto & y : x.S) {
            assert(!f.count(y));
            f[y] = x.F;
        }
    }
}

void test_case() {

    string ans;
    string s;
    cin >> s;
    assert(s.size() % 3 == 0);
    for (int i =0; i + 2 < s.size(); i+=3) {
        string actual = {s[i], s[i+1], s[i+2]};
        if (!f.count(actual)) {
            break;
        }
        ans += f[actual];
    }
    cout << ans << "\n";
}


// Pablo va por ti
// Cora :'v

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 3548kb

input:

50
GGUCAGAGGGAGGGCCUAUUGAUACGUAGUGGACUAUCAUGUUCGUGAGCAGCAUGCAGAUUACCCGUUCGGCGAGGGAGAGCCCGCUCCGAAAUGUUUAGGGAGAUAGCGGGCCACAUAGUCGCUUGAGUGCAUACUGCGUACUUUAUGUACAAGUCCCGU
AAUGGAUCACUCCUCUAUCAUUUCACUAGGUGUGACACAUGAUAUACUAACGUUCUGAAUUGGCAGUGGGGUAUGAGGCACUGAUUGGUCAUGGGACAGACUUGAGAGGAGUUGUCCUUGCUAAGCCCCGUCCC...

output:

GQREGLLIRSGL
NG
D

FACS
L
II
VLLRA

ESDQC
QNGIPKKAC

GI

AF
N
IH
DITYYELRTF
LEF

PYV
AAIPPTWGGKYWTFLIHNNILYSNEF
EL

NKR
RKFL
RSFKVQMLALR
W

RREAKS
KRFIFYG
NLRFFP
PCL
VWQFL
VR

TQLEIHGLTAERSHQKVQILHTDILPRTQDW
LR
SFST
FTKGFPIC
LIQQCCLIQHECS
FD
GI
IKL
PSSIVVLT
LN
V
ANN
LE
MELH

result:

wrong answer 1st lines differ - expected: 'GQREGLLIRSGLSCS', found: 'GQREGLLIRSGL'