QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61551#1361. Ant TypingSilverhorse7#WA 3ms3472kbC++20228b2022-11-14 05:24:442022-11-14 05:24:47

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-14 05:24:47]
  • Judged
  • Verdict: WA
  • Time: 3ms
  • Memory: 3472kb
  • [2022-11-14 05:24:44]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int ans = 0;
const int N =2e5+69;
string s;
signed main(){
	cin>>s;
	char curPos ='1';
	for(int i = 0 ; i  <s.size();i++)
		ans+=abs(s[i]-curPos),curPos=s[i];
	cout<<ans;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3472kb

input:

6

output:

5

result:

wrong answer 1st lines differ - expected: '1', found: '5'