Submission #581136

#TimeUsernameProblemLanguageResultExecution timeMemory
581136zaneyuMartian DNA (IOI16_dna)C++14
100 / 100
16 ms404 KiB
#include "dna.h" #include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; //order_of_key #of elements less than x // find_by_order kth element typedef long long int ll; #define ld long double #define pii pair<ll,int> typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; #define f first #define s second #define pb push_back #define REP(i,n) for(int i=0;i<n;i++) #define REP1(i,n) for(int i=1;i<=n;i++) #define FILL(n,x) memset(n,x,sizeof(n)) #define ALL(_a) _a.begin(),_a.end() #define sz(x) (int)x.size() const ll maxn=500+5; const ll maxlg=__lg(maxn)+2; const ll INF64=4e18; const int INF=0x3f3f3f3f; const ll MOD=1e9+7; const ld PI=acos(-1); const ld eps=1e-9; #define lowb(x) x&(-x) #define MNTO(x,y) x=min(x,(__typeof__(x))y) #define MXTO(x,y) x=max(x,(__typeof__(x))y) #define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end())))) #define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin()) string analyse(int n,int t){ int l=0,r=n; while(l<r){ int mid=(l+r+1)/2; if(make_test(string(mid,'0'))) l=mid; else r=mid-1; } string s(l,'0'); int p=0; while(p<=l){ s+='1'; if(!make_test(s)){ s.back()='0'; p++; }else p=0; } s=s.substr(0,sz(s)-l-1); while(1){ if(!make_test(s+'0'))break; s+='0'; } while(sz(s)<n){ s='1'+s; if(!make_test(s))s[0]='0'; } return s; }

Compilation message (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...