社区讨论
不建议使用 #include<bits/stdc++.h>
P12509通信题参与者 4已保存回复 7
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 7 条
- 当前快照
- 1 份
- 快照标识符
- @mhjstjwq
- 此快照首次捕获于
- 2025/11/04 07:56 4 个月前
- 此快照最后确认于
- 2025/11/04 07:56 4 个月前
你让 MSVC 用户情何以堪啊(
CPP#include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
using std::string;
int Alice(string S);
int Bob(string T, int X);
int main() {
string s_str, t_str;
cin >> s_str >> t_str;
int alice_val_x = Alice(s_str);
if (alice_val_x < 0 || alice_val_x >= (1 << 20)) {
cout << "Wrong Answer" << endl;
return 0;
}
int bob_val_p = Bob(t_str, alice_val_x);
if (bob_val_p < 0 || bob_val_p > (int)s_str.size()) {
cout << "Wrong Answer" << endl;
return 0;
}
if ((s_str == t_str && bob_val_p != 0) || (s_str != t_str && s_str[bob_val_p - 1] == t_str[bob_val_p - 1])) {
cout << "Wrong Answer" << endl;
return 0;
}
cout << "Accepted" << endl;
return 0;
}
回复
共 7 条回复,欢迎继续交流。
正在加载回复...