# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
831637 | KemalK | Martian DNA (IOI16_dna) | C++17 | 1 ms | 304 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dna.h"
#include <bits/stdc++.h>
#include <cstdlib>
using namespace std;
std::string analyse(int n, int t) {
string ans = "";
if (n <= 5){
cout << "first" << "\n";
bool ok = false;
for (int mask = 0; mask < (1<<n) - 1; mask++){
string cur = "";
for (int j = 0; j < n; j++){
if (mask>>j&1){
cur += "1";
}
else{
cur += "0";
}
}
ok = make_test(cur);
if (ok){
return cur;
}
}
if (!ok){
for(int i = 0; i < n; i++){
ans += "1";
}
return ans;
}
}
else if (n <= 100){
while (1){
if (make_test(ans + "0")){
ans = ans + "0";
}
else if (make_test(ans + "1")){
ans = ans + "1";
}
else{
break;
}
}
while(1){
if (make_test("1" + ans)){
ans = "1" + ans;
}
else if (make_test("0" + ans)){
ans = "0" + ans;
}
else{
break;
}
}
return ans;
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |