結果
問題 |
No.1085 桁和の桁和
|
ユーザー |
![]() |
提出日時 | 2020-06-16 13:53:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,035 bytes |
コンパイル時間 | 1,547 ms |
コンパイル使用メモリ | 166,408 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-22 23:59:26 |
合計ジャッジ時間 | 2,700 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 35 |
ソースコード
#include <bits/stdc++.h> /* strict input checker */ template<typename Integer = int> Integer read_int() { static_assert(std::numeric_limits<Integer>::is_specialized); int c = getchar(), sign = 0; Integer res = 0; if (c == '-') sign = 1, c = getchar(); assert('0' <= c && c <= '9'); if (sign) assert(c != '0'); res = c - '0'; while (1) { c = getchar(); if (c < '0' || c > '9') break; assert(res < std::numeric_limits<Integer>::max() / 10); // avoid overflow assert(res); // no leading-zero res = res * 10 + (c - '0'); } ungetc(c, stdin); return sign ? -res : res; } void read_linebreak() { int c = getchar(); if (c == '\r') c = getchar(); assert(c == '\n'); } int main() { std::string s; while (1) { int c = getchar(); if (c == '?' || (c >= '0' && c <= '9')) s.push_back(c); else { ungetc(c, stdin); break; } } read_linebreak(); assert(1 <= s.size() && s.size() <= 100000); int d = read_int(); read_linebreak(); assert(0 <= d && d <= 9); assert(getchar() == EOF); return 0; }