Submission #484373

# Submission time Handle Problem Language Result Execution time Memory
484373 2021-11-03T04:21:56 Z Carmel_Ab1 Martian DNA (IOI16_dna) C++17
0 / 100
27 ms 392 KB
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;
using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int>vi;
typedef vector<vector<int>>vvi;
typedef vector<ll>vl;
typedef vector<vl> vvl;
typedef pair<int,int>pi;
typedef pair<ll,ll> pl;
typedef vector<pl> vpl;
typedef vector<ld> vld;
typedef pair<ld,ld> pld;
typedef vector<pi> vpi;

//typedef tree<ll, null_type, less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
template<typename T> ostream& operator<<(ostream& os, vector<T>& a){os<<"[";for(int i=0; i<ll(a.size()); i++){os << a[i] << ((i!=ll(a.size()-1)?" ":""));}os << "]\n"; return os;}

#define all(x) x.begin(),x.end()
#define YES out("YES")
#define NO out("NO")
#define out(x){cout << x << "\n"; return;}
#define GLHF ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define print(x){for(auto ait:x) cout << ait << " "; cout << "\n";}
#define pb push_back
#define umap unordered_map

//#include "grader.cpp"
#include "dna.h"
string analyse(int n, int t) {
    string ans="0";
    if(!make_test("0"))
        return string(n,'1');
    while(ans.size()<n){
        if(make_test(ans+"0"))
            ans+='0';
        else
            ans+="1";

    }

    int l=1,r=n,sz=-1;
    while(l<=r){
        int m=(l+r)/2;
        if(make_test(ans.substr(0,m-1)))
            sz=m,l=m+1;
        else
            r=m-1;
    }
    while(ans.size()!=sz-1)
        ans.pop_back();

    while(1){
        if(make_test("0"+ans))
            ans="0"+ans;
        else if(make_test("1"+ans))
            ans="1"+ans;
        else
            break;
    }
    return ans;

}

Compilation message

dna.cpp: In function 'std::string analyse(int, int)':
dna.cpp:40:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   40 |     while(ans.size()<n){
      |           ~~~~~~~~~~^~
dna.cpp:56:21: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   56 |     while(ans.size()!=sz-1)
      |           ~~~~~~~~~~^~~~~~
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()) {
# Verdict Execution time Memory Grader output
1 Correct 1 ms 224 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Incorrect 0 ms 204 KB Wrong DNA
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Incorrect 0 ms 204 KB Wrong DNA
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Incorrect 0 ms 204 KB Wrong DNA
13 Correct 0 ms 204 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Incorrect 0 ms 204 KB Wrong DNA
17 Correct 0 ms 204 KB Output is correct
18 Incorrect 0 ms 204 KB Wrong DNA
19 Correct 0 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 0 ms 204 KB Output is correct
22 Incorrect 1 ms 204 KB Wrong DNA
23 Incorrect 1 ms 204 KB Wrong DNA
24 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Incorrect 0 ms 204 KB Wrong DNA
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Incorrect 0 ms 204 KB Wrong DNA
12 Correct 0 ms 204 KB Output is correct
13 Correct 0 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 0 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Incorrect 0 ms 204 KB Wrong DNA
23 Correct 1 ms 204 KB Output is correct
24 Correct 1 ms 204 KB Output is correct
25 Correct 0 ms 204 KB Output is correct
26 Incorrect 1 ms 204 KB Wrong DNA
27 Correct 1 ms 204 KB Output is correct
28 Correct 1 ms 204 KB Output is correct
29 Correct 0 ms 204 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Correct 0 ms 204 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Incorrect 0 ms 204 KB Wrong DNA
34 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Incorrect 0 ms 204 KB Wrong DNA
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Incorrect 1 ms 204 KB Wrong DNA
12 Incorrect 1 ms 204 KB Wrong DNA
13 Correct 0 ms 204 KB Output is correct
14 Incorrect 0 ms 204 KB Wrong DNA
15 Correct 0 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 0 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Incorrect 12 ms 332 KB Too many tests
23 Incorrect 19 ms 380 KB Too many tests
24 Incorrect 24 ms 388 KB Too many tests
25 Incorrect 26 ms 368 KB Too many tests
26 Incorrect 27 ms 392 KB Too many tests
27 Incorrect 7 ms 332 KB Wrong DNA
28 Correct 6 ms 332 KB Output is correct
29 Correct 6 ms 332 KB Output is correct
30 Correct 1 ms 204 KB Output is correct
31 Incorrect 8 ms 332 KB Wrong DNA
32 Correct 5 ms 332 KB Output is correct
33 Incorrect 13 ms 332 KB Too many tests
34 Incorrect 15 ms 376 KB Too many tests
35 Incorrect 10 ms 332 KB Too many tests
36 Incorrect 16 ms 332 KB Too many tests
37 Incorrect 16 ms 380 KB Too many tests
38 Incorrect 6 ms 332 KB Wrong DNA
39 Incorrect 16 ms 376 KB Too many tests