답안 #57706

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
57706 2018-07-15T21:17:49 Z Benq Martian DNA (IOI16_dna) C++14
36 / 100
19 ms 1352 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;

#include "dna.h"

string des = "011100101011101";

/*bool make_test(string s) {
    F0R(i,sz(des)-sz(s)+1) if (des.substr(0,sz(s)) == s) return 1;
    return 0;
}*/

string analyse(int n, int t) {
    string cur = "";
    while (1) {
        if (make_test(cur+"1")) cur += "1";
        else if (make_test(cur+"0")) cur += "0";
        else break;
    }
    while (sz(cur) < n) {
        if (make_test("1"+cur)) cur = "1"+cur;
        else cur = "0"+cur;
    }
    return cur;
}

Compilation message

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 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 596 KB Output is correct
4 Correct 2 ms 708 KB Output is correct
5 Correct 2 ms 708 KB Output is correct
6 Correct 2 ms 756 KB Output is correct
7 Correct 3 ms 756 KB Output is correct
8 Correct 3 ms 784 KB Output is correct
9 Correct 2 ms 784 KB Output is correct
10 Correct 2 ms 784 KB Output is correct
11 Correct 2 ms 784 KB Output is correct
12 Correct 2 ms 784 KB Output is correct
13 Correct 2 ms 784 KB Output is correct
14 Correct 4 ms 892 KB Output is correct
15 Correct 2 ms 892 KB Output is correct
16 Correct 2 ms 892 KB Output is correct
17 Correct 2 ms 912 KB Output is correct
18 Correct 2 ms 912 KB Output is correct
19 Correct 2 ms 912 KB Output is correct
20 Correct 3 ms 912 KB Output is correct
21 Correct 3 ms 912 KB Output is correct
22 Correct 3 ms 912 KB Output is correct
23 Correct 2 ms 912 KB Output is correct
24 Correct 2 ms 912 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 912 KB Output is correct
2 Correct 2 ms 960 KB Output is correct
3 Correct 2 ms 960 KB Output is correct
4 Correct 2 ms 960 KB Output is correct
5 Correct 2 ms 960 KB Output is correct
6 Correct 3 ms 960 KB Output is correct
7 Correct 2 ms 960 KB Output is correct
8 Correct 2 ms 960 KB Output is correct
9 Correct 2 ms 960 KB Output is correct
10 Correct 2 ms 992 KB Output is correct
11 Correct 2 ms 992 KB Output is correct
12 Correct 2 ms 992 KB Output is correct
13 Correct 2 ms 992 KB Output is correct
14 Correct 2 ms 992 KB Output is correct
15 Correct 2 ms 992 KB Output is correct
16 Correct 2 ms 992 KB Output is correct
17 Correct 3 ms 992 KB Output is correct
18 Correct 3 ms 992 KB Output is correct
19 Correct 3 ms 992 KB Output is correct
20 Correct 3 ms 992 KB Output is correct
21 Correct 3 ms 992 KB Output is correct
22 Correct 3 ms 992 KB Output is correct
23 Correct 3 ms 992 KB Output is correct
24 Correct 3 ms 992 KB Output is correct
25 Correct 4 ms 992 KB Output is correct
26 Correct 3 ms 992 KB Output is correct
27 Correct 3 ms 992 KB Output is correct
28 Correct 4 ms 992 KB Output is correct
29 Correct 3 ms 992 KB Output is correct
30 Correct 3 ms 992 KB Output is correct
31 Correct 3 ms 992 KB Output is correct
32 Correct 3 ms 992 KB Output is correct
33 Correct 2 ms 992 KB Output is correct
34 Correct 3 ms 992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 992 KB Output is correct
2 Correct 2 ms 992 KB Output is correct
3 Correct 3 ms 992 KB Output is correct
4 Correct 3 ms 992 KB Output is correct
5 Correct 3 ms 992 KB Output is correct
6 Correct 4 ms 992 KB Output is correct
7 Correct 2 ms 1004 KB Output is correct
8 Correct 2 ms 1008 KB Output is correct
9 Correct 2 ms 1008 KB Output is correct
10 Correct 3 ms 1012 KB Output is correct
11 Correct 3 ms 1016 KB Output is correct
12 Correct 2 ms 1024 KB Output is correct
13 Correct 3 ms 1024 KB Output is correct
14 Correct 2 ms 1028 KB Output is correct
15 Correct 2 ms 1032 KB Output is correct
16 Correct 2 ms 1036 KB Output is correct
17 Correct 2 ms 1040 KB Output is correct
18 Correct 3 ms 1044 KB Output is correct
19 Correct 3 ms 1048 KB Output is correct
20 Correct 3 ms 1052 KB Output is correct
21 Correct 2 ms 1160 KB Output is correct
22 Incorrect 16 ms 1180 KB Too many tests
23 Incorrect 15 ms 1184 KB Too many tests
24 Incorrect 17 ms 1192 KB Too many tests
25 Incorrect 17 ms 1196 KB Too many tests
26 Incorrect 17 ms 1328 KB Too many tests
27 Incorrect 13 ms 1328 KB Too many tests
28 Incorrect 12 ms 1332 KB Too many tests
29 Incorrect 18 ms 1332 KB Too many tests
30 Correct 9 ms 1332 KB Output is correct
31 Correct 9 ms 1332 KB Output is correct
32 Incorrect 19 ms 1352 KB Too many tests
33 Incorrect 14 ms 1352 KB Too many tests
34 Incorrect 13 ms 1352 KB Too many tests
35 Incorrect 13 ms 1352 KB Too many tests
36 Incorrect 14 ms 1352 KB Too many tests
37 Incorrect 13 ms 1352 KB Too many tests
38 Correct 13 ms 1352 KB Output is correct
39 Incorrect 15 ms 1352 KB Too many tests