結果
問題 |
No.9011 数字を全て足そう(数字だけ)
|
ユーザー |
|
提出日時 | 2020-10-24 22:46:07 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 2,566 bytes |
コンパイル時間 | 7,984 ms |
コンパイル使用メモリ | 214,544 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-21 15:48:10 |
合計ジャッジ時間 | 3,797 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
////////////////////////// // _ ____ // // U /"\ u U /"___| // // \/ _ \/ \| | u // // / ___ \ | |/__ // // /_/ \_\ \____| // // \\ >> _// \\ // // (__) (__)(__)(__) // // Compro by NULLCT // ////////////////////////// // STL libs #include <algorithm> #include <array> #include <bitset> #include <cctype> #include <chrono> #include <cinttypes> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <ios> #include <iostream> #include <iterator> #include <map> #include <numeric> #include <ostream> #include <queue> #include <set> #include <stack> #include <string> #include <thread> #include <tuple> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> // Boost #include <boost/multiprecision/cpp_int.hpp> #include <boost/range/irange.hpp> #define ALL(LIST) (LIST.begin()), (LIST.end()) using namespace std; using boost::irange; using boost::multiprecision::cpp_int; constexpr long MOD = 1000000007; class UnionFind { public: vector<long> par; UnionFind(long _n) : par(_n, -1) {} long root(long _n) { if (par[_n] < 0) return _n; else return par[_n] = root(par[_n]); } bool unite(long _main, long _sub) { long mainroot = root(_main); long subroot = root(_sub); if (mainroot == subroot) return false; par[mainroot] += par[subroot]; par[subroot] = mainroot; return true; } bool isSame(long _x, long _y) { return root(_x) == root(_y); } long size(long _n) { return -par[root(_n)]; } }; vector<long> divisor(const long _n) { vector<long> head, tail; for (long i = 1; i * i <= _n; i++) { if (_n % i == 0) { head.push_back(i); if (i * i != _n) tail.push_back(_n / i); } } head.insert(head.end(), tail.rbegin(), tail.rend()); return head; } long kadanes(const vector<long> &_n) { long highestMax = 0, currentMax = 0, length = _n.size(); for (long i = 0; i < length; i++) { currentMax = max(_n[i], currentMax + _n[i]); highestMax = max(highestMax, currentMax); } return highestMax; } void execution(); int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); execution(); return 0; } #define int long //-------------------------------------------------------------- inline void execution() { string s; cin>>s; int sum=0; for(auto i:s){ sum+=i-'0'; } cout<<sum<<"\n"; }