备赛区问题
2026-09-10 21:17:44
发布于:北京
@AC君
@AC君
@AC君
@AC君
GESP备赛区2024年12月6级卷第一道编程题有误,请看我的表演。
故事是这样的,我按惯例刷6级题,做完这套2024年12月6级卷,编程题第一道只拿了17.5分,why?
我把参考答案的代码复制出来:
#include <iostream>
#include <string>
using namespace std;
int main() {
int n;
long long s;
cin >> n >> s;
string moves;
cin >> moves;
long long pos = s;
for (char c : moves) {
if (c == 'U') {
if (pos != 1) {
pos /= 2;
}
} else if (c == 'L') {
pos = pos * 2;
} else if (c == 'R') {
pos = pos * 2 + 1;
}
}
cout << pos << endl;
return 0;
}
再次提交,发现还是17.5分。
不管我的代码对不对,能不能拿满分,参考代码不能错。
这里空空如也


















有帮助,赞一个