Submission #70035831
Source Code Expand
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; int f(int x){ if(x==0) return 1; int sum=0; while(x){ sum += x%10; x /= 10; } return sum; } int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; int A=1; for(int i=1; i<N; i++) A += f(A); cout << A << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Sum of Digits Sequence |
User | tkar821 |
Language | C++ 23 (gcc 12.2) |
Score | 200 |
Code Size | 417 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 3592 KiB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample00.txt, sample01.txt |
All | sample00.txt, sample01.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample00.txt | AC | 1 ms | 3392 KiB |
sample01.txt | AC | 1 ms | 3492 KiB |
testcase00.txt | AC | 1 ms | 3460 KiB |
testcase01.txt | AC | 1 ms | 3584 KiB |
testcase02.txt | AC | 1 ms | 3520 KiB |
testcase03.txt | AC | 1 ms | 3456 KiB |
testcase04.txt | AC | 1 ms | 3524 KiB |
testcase05.txt | AC | 1 ms | 3524 KiB |
testcase06.txt | AC | 1 ms | 3472 KiB |
testcase07.txt | AC | 1 ms | 3396 KiB |
testcase08.txt | AC | 1 ms | 3532 KiB |
testcase09.txt | AC | 1 ms | 3592 KiB |
testcase10.txt | AC | 1 ms | 3532 KiB |
testcase11.txt | AC | 1 ms | 3392 KiB |