Submission #66087121
Source Code Expand
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#include"atcoder/all"
using namespace atcoder;
typedef modint998244353 mi;
using namespace std;
#define all(a) a.begin(),a.end()
#define compress(a) sort(all(a));a.erase(unique(all(a)),a.end())
typedef long long ll;
typedef pair<ll,ll> P;
constexpr ll mod=998244353;
constexpr ll inf=3e18;
int main(){
string s;
cin>>s;
ll ans=s.size();
s.push_back('0');
for(int i=s.size()-2;i>=0;i--){
int d=int(s[i])-int(s[i+1]);
d=(d+10)%10;
ans+=d;
}
cout<<ans<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Security 2 |
| User | Rho17 |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 560 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 4264 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | AC | 1 ms | 3596 KiB |
| 00-sample-02.txt | AC | 1 ms | 3496 KiB |
| 00-sample-03.txt | AC | 1 ms | 3552 KiB |
| 01-01.txt | AC | 1 ms | 3496 KiB |
| 01-02.txt | AC | 1 ms | 3680 KiB |
| 01-03.txt | AC | 1 ms | 3596 KiB |
| 01-04.txt | AC | 1 ms | 3600 KiB |
| 01-05.txt | AC | 1 ms | 3600 KiB |
| 01-06.txt | AC | 1 ms | 3560 KiB |
| 01-07.txt | AC | 1 ms | 3492 KiB |
| 01-08.txt | AC | 1 ms | 3568 KiB |
| 01-09.txt | AC | 1 ms | 3612 KiB |
| 01-10.txt | AC | 2 ms | 3816 KiB |
| 01-11.txt | AC | 7 ms | 4060 KiB |
| 01-12.txt | AC | 7 ms | 4264 KiB |
| 01-13.txt | AC | 7 ms | 4176 KiB |
| 01-14.txt | AC | 7 ms | 4176 KiB |