Submission #202227

#TimeUsernameProblemLanguageResultExecution timeMemory
202227dolphingarlicGTA (COI14_gta)C++14
0 / 100
707 ms5640 KiB
#include <bits/stdc++.h> using namespace std; map<char, vector<int>> mp = { {'A', {1, 0, 3, 4, 5, 6, 7, 2}}, {'C', {2, 5, 6, 0, 7, 3, 1, 4}}, {'G', {7, 4, 5, 1, 6, 2, 0, 3}}, {'T', {4, 7, 1, 6, 2, 0, 3, 5}} }; vector<int> compose(vector<int> base, vector<int> trans) { vector<int> ret(base.size()); for (int i = 0; i < base.size(); i++) ret[trans[i]] = base[i]; return ret; } vector<int> perm[100]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; for (int i = 0; i < n; i++) { perm[i] = {0, 1, 2, 3, 4, 5, 6, 7}; string s; cin >> s; reverse(s.begin(), s.end()); for (char j : s) perm[i] = compose(perm[i], mp[j]); } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (perm[i] == perm[j]) cout << "1 "; else cout << "0 "; } cout << '\n'; } return 0; }

Compilation message (stderr)

gta.cpp: In function 'std::vector<int> compose(std::vector<int>, std::vector<int>)':
gta.cpp:13:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < base.size(); i++) ret[trans[i]] = base[i];
                  ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...