QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#770666#9741. CCPCLiyuanTuo#Compile Error//C++11307b2024-11-21 23:06:552024-11-21 23:06:56

Judging History

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

  • [2024-11-21 23:06:56]
  • 评测
  • [2024-11-21 23:06:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
string a;
int main()
{
	ios::sync_with_false(0),cin.tie(0),cout.tie(0);
	cin >> a;
	int cntc = 0, cntp = 0;
	for(int i = 0; i < a.size(); i++)
		if(a[i] == 'C')
			cntc++;
		else if(a[i] == 'P')
			cntp++;
			
	cout << min((cntc - 1) / 2, cntp);
}

详细

answer.code: In function ‘int main()’:
answer.code:6:14: error: ‘sync_with_false’ is not a member of ‘std::ios’ {aka ‘std::basic_ios<char>’}
    6 |         ios::sync_with_false(0),cin.tie(0),cout.tie(0);
      |              ^~~~~~~~~~~~~~~