QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#394628#1361. Ant TypingMohabX#WA 0ms3640kbC++23518b2024-04-20 17:02:012024-04-20 17:02:01

Judging History

This is the latest submission verdict.

  • [2024-04-20 17:02:01]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3640kb
  • [2024-04-20 17:02:01]
  • Submitted

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'