結果
問題 |
No.785 色食い虫
|
ユーザー |
|
提出日時 | 2019-02-27 19:35:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 942 bytes |
コンパイル時間 | 796 ms |
コンパイル使用メモリ | 68,940 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 05:19:03 |
合計ジャッジ時間 | 1,543 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include <string> #include <iostream> #include <cmath> bool ishex(char j) { if(std::isdigit(j) || j == 'A'|| j == 'B'|| j == 'C'|| j == 'D'|| j == 'E'|| j == 'F') { return true; } return false; } int main() { int a=0, b=0, c=0; for(int i = 0; i < 3; ++i) { std::string in; getline(std::cin, in); if(ishex(*in.begin())) { for(auto& j : in) { if(ishex(j)) { switch(i) { case 0: ++a; break; case 1: ++b; break; case 2: ++c; break; } } } } } a = (16-a)*(16-a); b = (16-b)*(16-b); c = (16-c)*(16-c); std::cout << a*b*c << std::endl; return 0; }