結果

問題 No.9011 数字を全て足そう(数字だけ)
ユーザー fuzzball
提出日時 2018-01-29 13:38:26
言語 Swift
(6.2.4)
コンパイル:
swiftc _filename_ -Ounchecked -o a.out
実行:
./a.out
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 65 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 10,327 ms
コンパイル使用メモリ 141,444 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2026-05-24 03:14:55
合計ジャッジ時間 11,614 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:1:19: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value [#DeprecatedDeclaration]
1 | print(readLine()!.flatMap {Int(String($0))}.reduce(0) {$0 + $1})
  |                   |- warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value [#DeprecatedDeclaration]
  |                   `- note: use 'compactMap(_:)' instead
2 | 

[#DeprecatedDeclaration]: <https://docs.swift.org/compiler/documentation/diagnostics/deprecated-declaration>

ソースコード

diff #
raw source code

print(readLine()!.flatMap {Int(String($0))}.reduce(0) {$0 + $1})
0