結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
![]() |
提出日時 | 2018-01-17 01:20:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 49 ms / 2,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 468 ms |
コンパイル使用メモリ | 57,432 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 05:58:57 |
合計ジャッジ時間 | 1,738 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 15 |
ソースコード
#include <iostream> #include <string> #include <sstream> int main() { int n; std::cin >> n; std::cin.ignore(); unsigned long long sum = 0; std::string input; std::getline(std::cin, input); std::stringstream ss{ input }; std::string buf; while (std::getline(ss, buf, ' ')) { sum += std::stoull(buf); } std::cout << sum << std::endl; return 0; }