# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
852992 | 2023-09-23T10:00:08 Z | hariaakas646 | Martian DNA (IOI16_dna) | C++17 | 1000 ms | 496 KB |
#include <bits/stdc++.h> #include "dna.h" using namespace std; #define scd(t) scanf("%d", &t) #define scld(t) scanf("%ld", &t) #define sclld(t) scanf("%lld", &t) #define scc(t) scanf("%c", &t) #define scs(t) scanf("%s", t) #define scf(t) scanf("%f", &t) #define sclf(t) scanf("%lf", &t) #define forr(i, j, k) for (int i = j; i < k; i++) #define frange(i, j) forr(i, 0, j) #define all(cont) cont.begin(), cont.end() #define mp make_pair #define pb push_back // #define f first // #define s second typedef long int li; typedef unsigned long int uli; typedef long long int lli; typedef unsigned long long int ulli; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<bool> vb; typedef vector<lli> vll; typedef vector<string> vs; typedef vector<pii> vii; typedef vector<vi> vvi; typedef map<int, int> mpii; typedef set<int> seti; typedef multiset<int> mseti; typedef long double ld; void usaco() { freopen("/media/hariaakash646/785EF1075EF0BF46/CompetitiveProgramming/input.in", "r", stdin); // freopen("problem.out", "w", stdout); } // static std::string s; // static int tests; // bool make_test(std::string p) { // tests++; // for (int i = 0; i < p.size(); i++) { // if (p[i] != '0' && p[i] != '1') { // return false; // } // } // std::string ss = p + "#" + s; // std::vector<int> pr(ss.size() + 1); // pr[0] = -1; // bool answer = false; // for (int i = 1; i <= ss.size(); i++) { // int k = pr[i - 1]; // while (k >= 0 && ss[k] != ss[i - 1]) // k = pr[k]; // pr[i] = k + 1; // if (pr[i] == p.size()) { // answer = true; // break; // } // } // return answer; // } string analyse(int n, int t) { string out = ""; int ls = 0; int nc = 1; frange(i, n) { out += '1'; bool ans = make_test(out); if(ans) { ls = i; nc = 0; } else { nc++; out[out.size()-1] = '0'; } if(nc >= 64) { if(make_test(out)) { nc = 0; ls = i; } else { int lo = 0; int hi = 64; while(lo != hi) { string curr=""; int mid = (lo + hi)/2; frange(i, ls+mid) { curr += out[i]; } if(make_test(curr)) { lo = mid; } else { hi = mid-1; } } string tmp = ""; frange(i, ls+lo) tmp += out[i]; out = tmp; break; } } } frange(i, n-out.size()) { out = '1' + out; if(!make_test(out)) { out[0] = '0'; } } return out; } // int main() { // usaco(); // int t; // std::cin >> s >> t; // std::string ans = analyse(s.size(), t); // std::cout << tests << std::endl << ans << std::endl; // return 0; // }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Incorrect | 1 ms | 344 KB | Wrong DNA |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Incorrect | 0 ms | 348 KB | Wrong DNA |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Incorrect | 0 ms | 348 KB | Wrong DNA |
12 | Incorrect | 1 ms | 344 KB | Wrong DNA |
13 | Correct | 0 ms | 344 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Incorrect | 0 ms | 348 KB | Wrong DNA |
17 | Correct | 0 ms | 348 KB | Output is correct |
18 | Incorrect | 0 ms | 444 KB | Wrong DNA |
19 | Correct | 0 ms | 348 KB | Output is correct |
20 | Correct | 0 ms | 348 KB | Output is correct |
21 | Incorrect | 0 ms | 348 KB | Wrong DNA |
22 | Incorrect | 0 ms | 348 KB | Wrong DNA |
23 | Incorrect | 0 ms | 348 KB | Wrong DNA |
24 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | Wrong DNA |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Incorrect | 0 ms | 348 KB | Wrong DNA |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Incorrect | 1 ms | 348 KB | Wrong DNA |
11 | Incorrect | 0 ms | 344 KB | Wrong DNA |
12 | Incorrect | 1 ms | 344 KB | Wrong DNA |
13 | Incorrect | 1 ms | 348 KB | Wrong DNA |
14 | Correct | 0 ms | 348 KB | Output is correct |
15 | Correct | 0 ms | 348 KB | Output is correct |
16 | Incorrect | 0 ms | 344 KB | Wrong DNA |
17 | Incorrect | 1 ms | 344 KB | Wrong DNA |
18 | Incorrect | 0 ms | 344 KB | Wrong DNA |
19 | Execution timed out | 1091 ms | 348 KB | Time limit exceeded |
20 | Execution timed out | 1072 ms | 348 KB | Time limit exceeded |
21 | Incorrect | 0 ms | 348 KB | Wrong DNA |
22 | Incorrect | 0 ms | 348 KB | Wrong DNA |
23 | Correct | 0 ms | 344 KB | Output is correct |
24 | Correct | 0 ms | 348 KB | Output is correct |
25 | Correct | 0 ms | 348 KB | Output is correct |
26 | Incorrect | 0 ms | 344 KB | Wrong DNA |
27 | Correct | 0 ms | 348 KB | Output is correct |
28 | Execution timed out | 1036 ms | 348 KB | Time limit exceeded |
29 | Incorrect | 0 ms | 348 KB | Wrong DNA |
30 | Execution timed out | 1082 ms | 348 KB | Time limit exceeded |
31 | Incorrect | 0 ms | 344 KB | Wrong DNA |
32 | Execution timed out | 1076 ms | 348 KB | Time limit exceeded |
33 | Incorrect | 0 ms | 348 KB | Wrong DNA |
34 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 344 KB | Output is correct |
4 | Incorrect | 0 ms | 348 KB | Wrong DNA |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Incorrect | 0 ms | 348 KB | Wrong DNA |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 348 KB | Output is correct |
10 | Incorrect | 0 ms | 348 KB | Wrong DNA |
11 | Incorrect | 0 ms | 344 KB | Wrong DNA |
12 | Incorrect | 0 ms | 348 KB | Wrong DNA |
13 | Incorrect | 1 ms | 348 KB | Wrong DNA |
14 | Incorrect | 0 ms | 348 KB | Wrong DNA |
15 | Incorrect | 0 ms | 348 KB | Wrong DNA |
16 | Incorrect | 0 ms | 348 KB | Wrong DNA |
17 | Incorrect | 0 ms | 348 KB | Wrong DNA |
18 | Incorrect | 0 ms | 348 KB | Wrong DNA |
19 | Incorrect | 0 ms | 348 KB | Wrong DNA |
20 | Execution timed out | 1100 ms | 348 KB | Time limit exceeded |
21 | Incorrect | 0 ms | 344 KB | Wrong DNA |
22 | Execution timed out | 1075 ms | 348 KB | Time limit exceeded |
23 | Execution timed out | 1055 ms | 348 KB | Time limit exceeded |
24 | Execution timed out | 1069 ms | 348 KB | Time limit exceeded |
25 | Execution timed out | 1054 ms | 348 KB | Time limit exceeded |
26 | Incorrect | 6 ms | 348 KB | Wrong DNA |
27 | Incorrect | 5 ms | 348 KB | Wrong DNA |
28 | Correct | 5 ms | 388 KB | Output is correct |
29 | Correct | 7 ms | 348 KB | Output is correct |
30 | Correct | 4 ms | 344 KB | Output is correct |
31 | Incorrect | 4 ms | 348 KB | Wrong DNA |
32 | Correct | 7 ms | 496 KB | Output is correct |
33 | Execution timed out | 1086 ms | 344 KB | Time limit exceeded |
34 | Execution timed out | 1037 ms | 344 KB | Time limit exceeded |
35 | Execution timed out | 1041 ms | 344 KB | Time limit exceeded |
36 | Execution timed out | 1048 ms | 344 KB | Time limit exceeded |
37 | Execution timed out | 1033 ms | 344 KB | Time limit exceeded |
38 | Execution timed out | 1043 ms | 348 KB | Time limit exceeded |
39 | Correct | 5 ms | 348 KB | Output is correct |