結果
問題 | No.785 色食い虫 |
ユーザー |
![]() |
提出日時 | 2022-07-22 14:50:31 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 889 bytes |
コンパイル時間 | 1,335 ms |
コンパイル使用メモリ | 132,496 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-03 22:19:14 |
合計ジャッジ時間 | 2,182 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#define _USE_MATH_DEFINES#include<iostream>#include<vector>#include<algorithm>#include<cmath>#include<string>#include<iomanip>#include<numeric>#include<queue>#include<deque>#include<stack>#include<set>#include<map>#include<random>using namespace std;typedef long long ll;const int mod=998244353;bool r[16],g[16],b[16];int main(){string sr,sg,sb;cin>>sr>>sg>>sb;for(int i=0;i<16;i++)r[i]=g[i]=b[i]=1;for(auto x:sr){if(sr=="NONE")break;if('0'<=x&&x<='9')r[x-'0']=0;if('A'<=x&&x<='F')r[x-'A'+10]=0;}for(auto x:sg){if(sg=="NONE")break;if('0'<=x&&x<='9')g[x-'0']=0;if('A'<=x&&x<='F')g[x-'A'+10]=0;}for(auto x:sb){if(sb=="NONE")break;if('0'<=x&&x<='9')b[x-'0']=0;if('A'<=x&&x<='F')b[x-'A'+10]=0;}int cr=count(r,r+16,1),cg=count(g,g+16,1),cb=count(b,b+16,1);cout<<cr*cr*cg*cg*cb*cb<<endl;}