Submission #1091359

#TimeUsernameProblemLanguageResultExecution timeMemory
1091359kotnidMartian DNA (IOI16_dna)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; set<string>st; bool make_test(strin p); int T = 0; // bool f(string s){ // string ans = "0"; // if(st.find(s) != st.end())return 0; // cout << "? " << s << endl; // T++; // return (ans.find(s) != string::npos); // } bool f(string s){ if(st.find(s) != st.end())return 0; // cout << "? " << s << endl; return make_test(s); // bool v; // cin >> v; // return v; } string analyse(int n, int t){ st.clear(); int len0 = 0; string s = "0"; while(s.size() <= n && f(s)){ len0++; s += "0"; } st.insert(s); s.pop_back(); if(len0 == 0){ string s2 = ""; for(int i=0; i<n; i++)s2 += "1"; return s2; // cout << "! "; // for(int i=0; i<n; i++)cout << 1; // cout << endl; // return ; } // right side int flag = 1; int cnt = 0; while(1){ s += (char)(flag+'0'); cnt++; if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue; st.insert(s); s.pop_back(); flag = 1-flag; s += (char)(flag+'0'); cnt = 1; if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue; st.insert(s); s.pop_back(); break; } flag = 1; cnt = 0; while(1){ s.insert(0, string(1,(char)(flag+'0'))); cnt++; if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue; st.insert(s); s.erase(s.begin()); flag = 1-flag; s.insert(0, string(1,(char)(flag+'0'))); cnt = 1; if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue; st.insert(s); s.erase(s.begin()); break; } return s; // cout << T << endl; } // int main(){ // int t; // cin >> t; // while(t--)solve(); // }

Compilation message (stderr)

dna.cpp:6:16: error: 'strin' was not declared in this scope; did you mean 'stdin'?
    6 | bool make_test(strin p);
      |                ^~~~~
      |                stdin
dna.cpp: In function 'bool f(std::string)':
dna.cpp:20:23: error: 'make_test' cannot be used as a function
   20 |     return make_test(s);
      |                       ^
dna.cpp: In function 'std::string analyse(int, int)':
dna.cpp:30:20: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   30 |     while(s.size() <= n && f(s)){
      |           ~~~~~~~~~^~~~
dna.cpp:52:47: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   52 |         if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue;
      |                                      ~~~~~~~~~^~~~
dna.cpp:58:47: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   58 |         if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue;
      |                                      ~~~~~~~~~^~~~
dna.cpp:69:47: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   69 |         if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue;
      |                                      ~~~~~~~~~^~~~
dna.cpp:75:47: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   75 |         if(!(!flag && cnt > len0) && s.size() <= n && f(s))continue;
      |                                      ~~~~~~~~~^~~~
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()) {