Submission #64099
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #include<bits/stdc++.h> #include<cmath> #include<queue> #include<algorithm> using namespace std; using ll= long long ; using db= double ; typedef vector< int > vii; typedef vector<ll> vll; typedef vector<string> vstr; typedef vector< bool > vbl; int inf=(1LL<<31)-1; int MOD=1000000007; #define fi(a,b) for(int i=a;i<b;i++) #define fj(a,b) for(int j=a;j<b;j++) #define f_i(a,b) for(int i=a;i<=b;i++) #define f_j(a,b) for(int j=a;j<=b;j++) #define vvii(c,a,b) vector<vector<ii>> c(a,vector<ii>(b,0)) #define vvll(c,a,b) vector<vector<ll>> c(a,vector<ll>(b,0)) #define vvstr(c,a,b) vector<vector<string> c(a,vector<string>(b,0)) #define vvbol(c,a,b) vector<vector<bool>> c(a,vector<bool>(b,true)) signed main() { cin.tie(nullptr); ios_base::sync_with_stdio( false ); string s; cin >> s; int num= atoi (s.c_str()); vll n(num+num,1); fi(0,num) { ostringstream ss; ss << i; int count=0; fj(0,ss.str().size()) { count+=ss.str().at(j)- '0' ; } n.at(i+count)+=n.at(i); } cout << n.at(num) << endl; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 1267 - 桁和 (Digit Sum) |
ユーザー名 | <span style="color:#000000;font-weight:bold;">ei2031</span> |
投稿日時 | 2020-09-17 08:19:18 |
言語 | C++17 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 1157 Byte |
最大実行時間 | 403 ms |
最大メモリ使用量 | 16188 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
01-01.txt | AC | 361 ms | 13916 KB |
1
|
01-02.txt | AC | 289 ms | 12080 KB |
1
|
01-03.txt | AC | 102 ms | 4008 KB |
1
|
01-04.txt | AC | 213 ms | 8264 KB |
1
|
01-05.txt | AC | 390 ms | 15936 KB |
1
|
01-06.txt | AC | 246 ms | 9520 KB |
1
|
01-07.txt | AC | 389 ms | 15436 KB |
1
|
01-08.txt | AC | 252 ms | 10496 KB |
1
|
01-09.txt | AC | 384 ms | 16008 KB |
1
|
01-10.txt | AC | 24 ms | 552 KB |
1
|
01-11.txt | AC | 21 ms | 636 KB |
1
|
01-12.txt | AC | 18 ms | 592 KB |
1
|
01-13.txt | AC | 23 ms | 544 KB |
1
|
01-14.txt | AC | 398 ms | 16116 KB |
1
|
01-15.txt | AC | 403 ms | 16188 KB |
1
|
01-16.txt | AC | 393 ms | 16132 KB |
1
|
01-17.txt | AC | 403 ms | 16076 KB |
1
|
sample-01.txt | AC | 20 ms | 536 KB |
1
|
sample-02.txt | AC | 21 ms | 492 KB |
1
|
sample-03.txt | AC | 19 ms | 576 KB |
1
|