結果
問題 |
No.5 数字のブロック
|
ユーザー |
|
提出日時 | 2020-12-14 18:47:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,727 bytes |
コンパイル時間 | 1,543 ms |
コンパイル使用メモリ | 168,428 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-20 00:51:09 |
合計ジャッジ時間 | 2,453 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 34 |
ソースコード
#include <bits/stdc++.h> #include <unistd.h> using namespace std; using i8 = int8_t; using u8 = uint8_t; using i16 = int16_t; using u16 = uint16_t; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; using i128 = __int128_t; using u128 = __uint128_t; using f32 = float; using f64 = double; #define cauto const auto& #define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); #define ALL(x) (x).begin(),(x).end() class Scanner { vector<char> buffer; ssize_t n_written; ssize_t n_read; public: Scanner(): buffer(1024*1024) { do_read(); } int64_t read_int() { int64_t ret = 0, sgn = 1; int ch = current_char(); while (isspace(ch)) { ch = next_char(); } if (ch == '-') { sgn = -1; ch = next_char(); } for (; isdigit(ch); ch = next_char()) ret = (ret * 10) + (ch - '0'); return sgn * ret; } private: void do_read() { ssize_t r = read(0, &buffer[0], buffer.size()); if (r < 0) { throw runtime_error(strerror(errno)); } n_written = r; n_read = 0; } inline int next_char() { ++n_read; if (n_read == n_written) { do_read(); } return current_char(); } inline int current_char() { return (n_read == n_written) ? EOF : buffer[n_read]; } }; int main() { Scanner scanner; int L = scanner.read_int(); int M = scanner.read_int(); int N = scanner.read_int(); if (N >= 25) { M += N / 25; N %= 25; } if (M >= 4) { L += M / 4; M %= 4; } if (L >= 10) { L %= 10; } printf("%d\n", L + M + N); return 0; }