Submission #66115055
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define TRACE 1
#define tcout TRACE && cout
#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
const int P = 998244353;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10, M = 2e6 + 10;
int a[N];
int cnt,k,b;
signed main()
{
fst;
string s;
cin>>s;
for(int i=s.size()-1;i>=0;i--)
{
k=s[i]-'0';
b=(k-cnt)%10;
if(b<0)
{
b+=10;
}
cnt+=b;
a[i]=b;
}
cout<<cnt+s.size();
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Security 2 |
| User | majingyi |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 560 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 7544 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 | 3432 KiB |
| 00-sample-02.txt | AC | 1 ms | 3376 KiB |
| 00-sample-03.txt | AC | 1 ms | 3412 KiB |
| 01-01.txt | AC | 1 ms | 3320 KiB |
| 01-02.txt | AC | 1 ms | 3408 KiB |
| 01-03.txt | AC | 1 ms | 3440 KiB |
| 01-04.txt | AC | 1 ms | 3388 KiB |
| 01-05.txt | AC | 1 ms | 3320 KiB |
| 01-06.txt | AC | 1 ms | 3516 KiB |
| 01-07.txt | AC | 1 ms | 3528 KiB |
| 01-08.txt | AC | 1 ms | 3468 KiB |
| 01-09.txt | AC | 1 ms | 3420 KiB |
| 01-10.txt | AC | 1 ms | 4052 KiB |
| 01-11.txt | AC | 5 ms | 7508 KiB |
| 01-12.txt | AC | 5 ms | 7544 KiB |
| 01-13.txt | AC | 5 ms | 7496 KiB |
| 01-14.txt | AC | 5 ms | 7476 KiB |