답안 #434382

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
434382 2021-06-21T07:11:02 Z 79brue Martian DNA (IOI16_dna) C++14
0 / 100
11 ms 544 KB
#include <bits/stdc++.h>
#include "dna.h"

using namespace std;

typedef long long ll;

string analyse(int n, int t){
    int MIN = 1, MAX = n, ANS = 0;
    while(MIN <= MAX){
        int MID = (MIN + MAX) / 2;
        if(make_test(string(MID, '0'))){
            ANS = MID;
            MIN = MID + 1;
        }
        else MAX = MID - 1;
    }

    if(!ANS) return string(n, '1');

    string str (1, ANS);
    int cnt = ANS;
    while(cnt <= ANS){
        if(!make_test(str + '1')){
            cnt++;
            str += '0';
        }
        else{
            cnt = 0;
            str += '1';
        }
    }

    while(cnt--) str.pop_back();

    MIN = 1, MAX = n, ANS = 0;
    while(MIN <= MAX){
        int MID = (MIN + MAX) / 2;
        if(make_test(str + string(MID, '0'))){
            ANS = MID;
            MIN = MID + 1;
        }
        else MAX = MID - 1;
    }
    str += string(ANS, '0');

    while((int)str.size() < n){
        if(make_test("1" + str)) str = "1" + str;
        else str = "0" + str;
    }

    return str;
}

Compilation message

grader.cpp: In function 'bool make_test(std::string)':
grader.cpp:14:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for (int i = 0; i < p.size(); i++) {
      |                  ~~^~~~~~~~~~
grader.cpp:23:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for (int i = 1; i <= ss.size(); i++) {
      |                  ~~^~~~~~~~~~~~
grader.cpp:28:13: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |   if (pr[i] == p.size()) {
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Runtime error 3 ms 412 KB Execution killed with signal 6
4 Incorrect 1 ms 204 KB Wrong DNA
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Runtime error 1 ms 288 KB Execution killed with signal 11
8 Runtime error 3 ms 460 KB Execution killed with signal 6
9 Correct 1 ms 204 KB Output is correct
10 Incorrect 1 ms 204 KB Wrong DNA
11 Runtime error 1 ms 332 KB Execution killed with signal 11
12 Incorrect 1 ms 204 KB Wrong DNA
13 Correct 1 ms 204 KB Output is correct
14 Runtime error 1 ms 332 KB Execution killed with signal 11
15 Correct 0 ms 204 KB Output is correct
16 Incorrect 1 ms 204 KB Wrong DNA
17 Runtime error 1 ms 332 KB Execution killed with signal 11
18 Incorrect 1 ms 204 KB Wrong DNA
19 Runtime error 2 ms 332 KB Execution killed with signal 11
20 Incorrect 1 ms 204 KB Wrong DNA
21 Runtime error 3 ms 460 KB Execution killed with signal 6
22 Runtime error 1 ms 332 KB Execution killed with signal 11
23 Runtime error 3 ms 460 KB Execution killed with signal 6
24 Runtime error 2 ms 540 KB Execution killed with signal 6
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Runtime error 3 ms 460 KB Execution killed with signal 6
4 Incorrect 1 ms 204 KB Wrong DNA
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB Wrong DNA
8 Correct 1 ms 204 KB Output is correct
9 Runtime error 1 ms 332 KB Execution killed with signal 11
10 Runtime error 1 ms 332 KB Execution killed with signal 11
11 Runtime error 1 ms 332 KB Execution killed with signal 11
12 Runtime error 3 ms 460 KB Execution killed with signal 6
13 Runtime error 1 ms 332 KB Execution killed with signal 11
14 Runtime error 1 ms 332 KB Execution killed with signal 11
15 Runtime error 1 ms 292 KB Execution killed with signal 11
16 Runtime error 3 ms 460 KB Execution killed with signal 6
17 Runtime error 1 ms 332 KB Execution killed with signal 11
18 Runtime error 1 ms 332 KB Execution killed with signal 11
19 Runtime error 1 ms 332 KB Execution killed with signal 11
20 Runtime error 1 ms 332 KB Execution killed with signal 11
21 Runtime error 1 ms 332 KB Execution killed with signal 11
22 Incorrect 1 ms 204 KB Wrong DNA
23 Correct 1 ms 288 KB Output is correct
24 Runtime error 1 ms 332 KB Execution killed with signal 11
25 Correct 1 ms 204 KB Output is correct
26 Incorrect 1 ms 204 KB Wrong DNA
27 Runtime error 1 ms 332 KB Execution killed with signal 11
28 Runtime error 1 ms 332 KB Execution killed with signal 11
29 Runtime error 3 ms 544 KB Execution killed with signal 6
30 Runtime error 1 ms 332 KB Execution killed with signal 11
31 Runtime error 3 ms 460 KB Execution killed with signal 6
32 Runtime error 1 ms 332 KB Execution killed with signal 11
33 Runtime error 1 ms 332 KB Execution killed with signal 11
34 Runtime error 1 ms 332 KB Execution killed with signal 11
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 292 KB Output is correct
3 Runtime error 3 ms 460 KB Execution killed with signal 6
4 Incorrect 1 ms 204 KB Wrong DNA
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Incorrect 1 ms 204 KB Wrong DNA
8 Correct 1 ms 204 KB Output is correct
9 Runtime error 1 ms 292 KB Execution killed with signal 11
10 Runtime error 1 ms 332 KB Execution killed with signal 11
11 Runtime error 1 ms 332 KB Execution killed with signal 11
12 Runtime error 3 ms 460 KB Execution killed with signal 6
13 Incorrect 1 ms 292 KB Wrong DNA
14 Runtime error 1 ms 332 KB Execution killed with signal 11
15 Runtime error 3 ms 460 KB Execution killed with signal 6
16 Runtime error 1 ms 332 KB Execution killed with signal 11
17 Runtime error 1 ms 332 KB Execution killed with signal 11
18 Runtime error 1 ms 332 KB Execution killed with signal 11
19 Runtime error 1 ms 332 KB Execution killed with signal 11
20 Runtime error 1 ms 332 KB Execution killed with signal 11
21 Runtime error 1 ms 332 KB Execution killed with signal 11
22 Runtime error 1 ms 332 KB Execution killed with signal 11
23 Runtime error 1 ms 332 KB Execution killed with signal 11
24 Runtime error 1 ms 332 KB Execution killed with signal 11
25 Runtime error 1 ms 332 KB Execution killed with signal 11
26 Runtime error 1 ms 332 KB Execution killed with signal 11
27 Incorrect 8 ms 332 KB Wrong DNA
28 Correct 8 ms 332 KB Output is correct
29 Runtime error 1 ms 416 KB Execution killed with signal 11
30 Correct 1 ms 204 KB Output is correct
31 Incorrect 11 ms 388 KB Wrong DNA
32 Runtime error 1 ms 412 KB Execution killed with signal 11
33 Runtime error 1 ms 420 KB Execution killed with signal 11
34 Runtime error 1 ms 332 KB Execution killed with signal 11
35 Runtime error 1 ms 432 KB Execution killed with signal 11
36 Runtime error 3 ms 460 KB Execution killed with signal 6
37 Runtime error 3 ms 460 KB Execution killed with signal 6
38 Runtime error 1 ms 420 KB Execution killed with signal 11
39 Runtime error 1 ms 332 KB Execution killed with signal 11