1 solutions
Information
- ID
- 196
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- # Submissions
- 72
- Accepted
- 25
- Uploaded By
总所周知,kirk 是善良学长,每次出题都在默默关照大家
经过分析可得,当 kirk 和 night 的答案相同就得两分,不同最多只能对一个,由此累加就是最高分
当然两人运气有可能同时背时,可能一个都不对,最低分就是 0
#include <iostream>
using namespace std;
void read(int n, char *str) {
for (int i = 0; i < n; i++)
cin >> str[i];
}
int main() {
int n;
cin >> n;
char anwser1[n + 5], anwser2[n + 5];
read(n, anwser1);
read(n, anwser2);
int score = 0;
for (int i = 0; i < n; i++)
if (anwser1[i] == anwser2[i])
score += 2;
else
score++;
cout << score << " " << 0 << endl;
return 0;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.