# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
952339 | 2024-03-23T14:45:45 Z | wood | DNA 돌연변이 (IOI21_dna) | C++17 | 30 ms | 6428 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> p32; typedef pair<ll, ll> p64; #define pb push_back #define eb emplace_back #define fi first #define se second #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define MOD %1000000007 vector<ll> pref_b; vector<ll> pref_a; vector<ll> pref_b2; vector<ll> pref_a2; vector<ll> matchpref; void init(string a, string b) { ll n = a.size(); pref_a.resize(n+1); pref_b.resize(n+1); pref_a2.resize(n+1); pref_b2.resize(n+1); matchpref.resize(n+1); for (size_t i = 0; i < a.size(); i++) { pref_a[i + 1] = pref_a[i] + (a[i] == 'A'); pref_b[i + 1] = pref_b[i] + (b[i] == 'A'); pref_a2[i + 1] = pref_a2[i] + (a[i] == 'T'); pref_b2[i + 1] = pref_b2[i] + (b[i] == 'T'); matchpref[i + 1] = matchpref[i]+((a[i] == 'A') && (b[i] == 'T')||((a[i]=='T')&&(b[i]=='C'))); } } ll get_distance(int x, int y) { if ((pref_a[y + 1] - pref_a[x] != pref_b[y + 1] - pref_b[x])||(pref_a2[y+1]-pref_a2[x]!= pref_b2[y+1]-pref_b2[x])) { return -1; } else return (matchpref[y + 1] - matchpref[x]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 6172 KB | Output is correct |
2 | Correct | 26 ms | 6156 KB | Output is correct |
3 | Incorrect | 25 ms | 5724 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 3 ms | 4700 KB | Output is correct |
5 | Correct | 3 ms | 4952 KB | Output is correct |
6 | Correct | 3 ms | 4952 KB | Output is correct |
7 | Correct | 3 ms | 4444 KB | Output is correct |
8 | Correct | 3 ms | 4956 KB | Output is correct |
9 | Correct | 3 ms | 4952 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 3 ms | 4700 KB | Output is correct |
5 | Correct | 3 ms | 4952 KB | Output is correct |
6 | Correct | 3 ms | 4952 KB | Output is correct |
7 | Correct | 3 ms | 4444 KB | Output is correct |
8 | Correct | 3 ms | 4956 KB | Output is correct |
9 | Correct | 3 ms | 4952 KB | Output is correct |
10 | Correct | 26 ms | 6116 KB | Output is correct |
11 | Correct | 25 ms | 6164 KB | Output is correct |
12 | Correct | 26 ms | 6176 KB | Output is correct |
13 | Correct | 29 ms | 6428 KB | Output is correct |
14 | Correct | 30 ms | 6412 KB | Output is correct |
15 | Correct | 30 ms | 6344 KB | Output is correct |
16 | Correct | 26 ms | 6176 KB | Output is correct |
17 | Correct | 26 ms | 6176 KB | Output is correct |
18 | Correct | 26 ms | 6420 KB | Output is correct |
19 | Correct | 25 ms | 6172 KB | Output is correct |
20 | Correct | 26 ms | 6424 KB | Output is correct |
21 | Correct | 25 ms | 6416 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 1 ms | 348 KB | Output is correct |
4 | Correct | 3 ms | 4700 KB | Output is correct |
5 | Correct | 3 ms | 4952 KB | Output is correct |
6 | Correct | 3 ms | 4952 KB | Output is correct |
7 | Correct | 3 ms | 4444 KB | Output is correct |
8 | Correct | 3 ms | 4956 KB | Output is correct |
9 | Correct | 3 ms | 4952 KB | Output is correct |
10 | Incorrect | 4 ms | 4444 KB | Output isn't correct |
11 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 25 ms | 6172 KB | Output is correct |
2 | Correct | 26 ms | 6156 KB | Output is correct |
3 | Incorrect | 25 ms | 5724 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |