답안 #162266

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
162266 2019-11-07T11:13:02 Z popovicirobert Martian DNA (IOI16_dna) C++14
0 / 100
16 ms 632 KB
#include "dna.h"
#include <bits/stdc++.h>

using namespace std;

std::string analyse(int n, int t) {
    if(make_test("0") == 0) {
        string sol;
        sol.resize(n);
        fill(sol.begin(), sol.end(), '1');
        return sol;
    }
    string sol = "0";
    while(sol.size() < n) {
        sol.push_back(sol.back());
        if(make_test(sol)) {
            continue;
        }
        sol.back() = '0' + ((sol.back() - '0') ^ 1);
        if(make_test(sol)) {
            continue;
        }
        break;
    }
    while(sol.size() < n) {
        sol = sol.substr(0, 1) + sol;
        if(make_test(sol)) {
            continue;
        }
        sol[0] = '0' + ((sol.back() - '0') ^ 1);
    }
    return sol;
}

Compilation message

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:14:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(sol.size() < n) {
           ~~~~~~~~~~~^~~
dna.cpp:25:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(sol.size() < n) {
           ~~~~~~~~~~~^~~
grader.cpp: In function 'bool make_test(std::__cxx11::string)':
grader.cpp:14:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < p.size(); i++) {
                  ~~^~~~~~~~~~
grader.cpp:23:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i <= ss.size(); i++) {
                  ~~^~~~~~~~~~~~
grader.cpp:28:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (pr[i] == p.size()) {
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 380 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Incorrect 2 ms 376 KB Wrong DNA
6 Correct 2 ms 632 KB Output is correct
7 Incorrect 2 ms 376 KB Wrong DNA
8 Incorrect 2 ms 376 KB Wrong DNA
9 Correct 2 ms 376 KB Output is correct
10 Incorrect 2 ms 376 KB Wrong DNA
11 Incorrect 2 ms 256 KB Wrong DNA
12 Correct 2 ms 376 KB Output is correct
13 Incorrect 2 ms 376 KB Wrong DNA
14 Correct 2 ms 256 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Incorrect 2 ms 256 KB Wrong DNA
18 Correct 2 ms 256 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Incorrect 2 ms 376 KB Wrong DNA
21 Incorrect 2 ms 256 KB Wrong DNA
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 380 KB Output is correct
24 Incorrect 2 ms 256 KB Wrong DNA
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 508 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Incorrect 2 ms 376 KB Wrong DNA
6 Correct 2 ms 376 KB Output is correct
7 Incorrect 2 ms 376 KB Wrong DNA
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Incorrect 3 ms 476 KB Wrong DNA
11 Correct 2 ms 256 KB Output is correct
12 Incorrect 2 ms 256 KB Wrong DNA
13 Incorrect 2 ms 376 KB Wrong DNA
14 Incorrect 2 ms 376 KB Wrong DNA
15 Incorrect 2 ms 256 KB Wrong DNA
16 Incorrect 2 ms 256 KB Wrong DNA
17 Incorrect 3 ms 376 KB Wrong DNA
18 Incorrect 2 ms 376 KB Wrong DNA
19 Incorrect 2 ms 376 KB Wrong DNA
20 Incorrect 2 ms 256 KB Wrong DNA
21 Incorrect 2 ms 252 KB Wrong DNA
22 Correct 2 ms 376 KB Output is correct
23 Incorrect 2 ms 296 KB Wrong DNA
24 Correct 2 ms 256 KB Output is correct
25 Correct 2 ms 256 KB Output is correct
26 Correct 2 ms 256 KB Output is correct
27 Incorrect 2 ms 256 KB Wrong DNA
28 Incorrect 2 ms 376 KB Wrong DNA
29 Incorrect 2 ms 256 KB Wrong DNA
30 Incorrect 2 ms 256 KB Wrong DNA
31 Incorrect 2 ms 252 KB Wrong DNA
32 Incorrect 2 ms 376 KB Wrong DNA
33 Correct 2 ms 256 KB Output is correct
34 Incorrect 2 ms 356 KB Wrong DNA
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Incorrect 2 ms 376 KB Wrong DNA
6 Correct 2 ms 376 KB Output is correct
7 Incorrect 2 ms 256 KB Wrong DNA
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Incorrect 2 ms 256 KB Wrong DNA
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Incorrect 2 ms 376 KB Wrong DNA
14 Correct 2 ms 376 KB Output is correct
15 Incorrect 2 ms 376 KB Wrong DNA
16 Incorrect 2 ms 256 KB Wrong DNA
17 Incorrect 2 ms 376 KB Wrong DNA
18 Incorrect 2 ms 256 KB Wrong DNA
19 Incorrect 2 ms 376 KB Wrong DNA
20 Incorrect 2 ms 256 KB Wrong DNA
21 Incorrect 2 ms 376 KB Wrong DNA
22 Incorrect 13 ms 376 KB Wrong DNA
23 Incorrect 13 ms 376 KB Wrong DNA
24 Incorrect 13 ms 376 KB Wrong DNA
25 Incorrect 12 ms 376 KB Wrong DNA
26 Incorrect 13 ms 376 KB Wrong DNA
27 Incorrect 15 ms 376 KB Too many tests
28 Incorrect 14 ms 376 KB Wrong DNA
29 Correct 8 ms 376 KB Output is correct
30 Correct 2 ms 376 KB Output is correct
31 Correct 8 ms 376 KB Output is correct
32 Incorrect 9 ms 376 KB Wrong DNA
33 Incorrect 15 ms 376 KB Wrong DNA
34 Incorrect 13 ms 376 KB Wrong DNA
35 Incorrect 16 ms 376 KB Wrong DNA
36 Incorrect 14 ms 376 KB Wrong DNA
37 Incorrect 16 ms 376 KB Wrong DNA
38 Correct 8 ms 376 KB Output is correct
39 Incorrect 11 ms 376 KB Wrong DNA