답안 #831644

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
831644 2023-08-20T11:49:23 Z OrazB Martian DNA (IOI16_dna) C++14
11 / 100
1000 ms 1144 KB
#include <bits/stdc++.h>
#include "dna.h"
using namespace std;
#define pb push_back

string analyse(int n, int t) {
    vector<string> vec;
    bool tr = make_test("0");
    if (tr == true) vec.pb("0");
    tr = make_test("1");
    if (tr == true) vec.pb("1");
    
    while(1){
        if (vec[0].size() == n) return vec[0];
        vector<string> new_vec;
        for (auto i : vec){
            string a = i, b = i;
            a += '0';
            b += '1';
            bool A = make_test(a);
            bool B = make_test(b);
            if (A == true) new_vec.pb(a);
            if (B == true) new_vec.pb(b);
        }
        vec = new_vec;
    }
}         

Compilation message

dna.cpp: In function 'std::string analyse(int, int)':
dna.cpp:14:27: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |         if (vec[0].size() == n) return vec[0];
      |             ~~~~~~~~~~~~~~^~~~
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 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 224 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 0 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Incorrect 8 ms 340 KB Too many tests
18 Incorrect 8 ms 340 KB Too many tests
19 Incorrect 8 ms 212 KB Too many tests
20 Incorrect 8 ms 324 KB Too many tests
21 Incorrect 7 ms 340 KB Too many tests
22 Incorrect 1 ms 212 KB Too many tests
23 Incorrect 1 ms 212 KB Too many tests
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Incorrect 1 ms 212 KB Too many tests
27 Incorrect 1 ms 212 KB Too many tests
28 Incorrect 7 ms 312 KB Too many tests
29 Incorrect 7 ms 312 KB Too many tests
30 Incorrect 7 ms 212 KB Too many tests
31 Incorrect 7 ms 340 KB Too many tests
32 Incorrect 7 ms 340 KB Too many tests
33 Incorrect 5 ms 340 KB Too many tests
34 Incorrect 5 ms 340 KB Too many tests
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Incorrect 8 ms 320 KB Too many tests
18 Incorrect 8 ms 332 KB Too many tests
19 Incorrect 8 ms 212 KB Too many tests
20 Incorrect 7 ms 324 KB Too many tests
21 Incorrect 8 ms 324 KB Too many tests
22 Execution timed out 1086 ms 524 KB Time limit exceeded
23 Execution timed out 1079 ms 820 KB Time limit exceeded
24 Execution timed out 1084 ms 852 KB Time limit exceeded
25 Execution timed out 1069 ms 684 KB Time limit exceeded
26 Execution timed out 1069 ms 648 KB Time limit exceeded
27 Incorrect 19 ms 340 KB Too many tests
28 Incorrect 19 ms 436 KB Too many tests
29 Incorrect 13 ms 340 KB Too many tests
30 Incorrect 11 ms 404 KB Too many tests
31 Incorrect 21 ms 428 KB Too many tests
32 Incorrect 21 ms 476 KB Too many tests
33 Execution timed out 1075 ms 712 KB Time limit exceeded
34 Execution timed out 1091 ms 812 KB Time limit exceeded
35 Execution timed out 1074 ms 856 KB Time limit exceeded
36 Execution timed out 1081 ms 908 KB Time limit exceeded
37 Execution timed out 1071 ms 1144 KB Time limit exceeded
38 Execution timed out 1073 ms 1124 KB Time limit exceeded
39 Execution timed out 1047 ms 956 KB Time limit exceeded