QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#499545#6726. Turn It OffpagohiaCompile Error//C++14600b2024-07-31 15:34:292024-07-31 15:34:30

Judging History

你现在查看的是最新测评结果

  • [2024-07-31 15:34:30]
  • 评测
  • [2024-07-31 15:34:29]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

string s;
int L, k, len;

bool f(int LL)
{
 int cnt = 0;
 for(int i = 0; i < len; i++)
 if(s[i] == '1')
 {
 i += (LL - 1);
 cnt++;
 if(cnt > k)
 return 1;
 }
 return 0;
}

void F(int l, int r)
{
 int m = (l + r) / 2;
 if(f(l) && !f(l + 1))
 L = l + 1;
 else if(f(m))
 F(m, r);
 else
F(l, m - 1);
}

int main()
{
ios::sycn_with_stdio(false);
cin.tie(0);
cout.tie(0);
 int t;
 cin >> t;
 while(t--)
 {
cin >> len >> k;
 cin >> s;
 L = len / k + 1;
if(len % k == 0)
 L--;
 F(1, L);
 cout << L << endl;
 }
}

详细

answer.code: In function ‘int main()’:
answer.code:35:6: error: ‘sycn_with_stdio’ is not a member of ‘std::ios’ {aka ‘std::basic_ios<char>’}
   35 | ios::sycn_with_stdio(false);
      |      ^~~~~~~~~~~~~~~