結果
問題 | No.2920 Blood Type |
ユーザー |
![]() |
提出日時 | 2024-10-12 16:29:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 997 bytes |
コンパイル時間 | 964 ms |
コンパイル使用メモリ | 94,824 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 16:30:04 |
合計ジャッジ時間 | 1,993 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <functional> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <tuple> #include <cstdio> #include <cmath> #include <cassert> #define rep(i, n) for(i = 0; i < n; i++) #define int long long using namespace std; string ketsueki(char s, char t) { if ((s == 'A' || t == 'A') && (s != 'B' && t != 'B')) return "A"; if ((s == 'B' || t == 'B') && (s != 'A' && t != 'A')) return "B"; if ((s == 'A' || t == 'A') && (s == 'B' || t == 'B')) return "AB"; return "O"; } signed main() { string s, t; map<string, int> mp; cin >> s >> t; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { string res = ketsueki(s[i], t[j]); //cout << s[i] << ", " << t[j] << " -> " << res << endl; mp[res]++; } } printf("%lld %lld %lld %lld\n", mp["A"] * 25, mp["B"] * 25, mp["AB"] * 25, mp["O"] * 25); return 0; }