QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#394628 | #1361. Ant Typing | MohabX# | WA | 0ms | 3640kb | C++23 | 518b | 2024-04-20 17:02:01 | 2024-04-20 17:02:01 |
Judging History
answer
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define Mohab ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define el '\n'
void RRR() {
string s; cin>>s;
ll sum=s[0]-'0';
for (int i=1; i<s.size(); i++){
sum+=abs((s[i]-'0') - (s[i-1]-'0'));
}
cout<<sum-1;
}
signed main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
Mohab
int T = 1;
// cin >> T;
while (T--)
RRR();
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3640kb
input:
6
output:
5
result:
wrong answer 1st lines differ - expected: '1', found: '5'