QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#61551 | #1361. Ant Typing | Silverhorse7# | WA | 3ms | 3472kb | C++20 | 228b | 2022-11-14 05:24:44 | 2022-11-14 05:24:47 |
Judging History
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'