在本地测没问题,洛谷上全部RE,救救孩子吧!
查看原帖
在本地测没问题,洛谷上全部RE,救救孩子吧!
694295
yuanbingtao楼主2022/6/26 15:58
#include <iostream>

using namespace std;

int n, ans;
bool flag[270];

struct S {
	char c;
	int vs () {
		return c - 'A';
	}
	char& operator ->(){
		return c;
	}
	void read() {
		cin >> c;
	}
	bool& operator !=(S i) {
		bool f = c != i.c;
		return f;
	}
}b;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		S a;
		a.read();
		if (b != a) {
			ans++, b = a;
		}
	}
	cout << ans + 1 << endl;
	return 0;
}
2022/6/26 15:58
加载中...