結果
問題 | No.2920 Blood Type |
ユーザー |
|
提出日時 | 2024-10-12 14:42:12 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 677 bytes |
コンパイル時間 | 1,444 ms |
コンパイル使用メモリ | 129,324 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-12 14:42:18 |
合計ジャッジ時間 | 2,401 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 |
ソースコード
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <string> #include <utility> #include <tuple> #include <set> #include <map> #include <cassert> using namespace std; int main() { string s, t; cin >> s >> t; vector<int> v(4); for (char c1: s) { for (char c2: t) { bool hasA = c1 == 'A' || c2 == 'A'; bool hasB = c1 == 'B' || c2 == 'B'; // fprintf(stderr, "%c%c, %d %d\n", c1,c2, hasA, hasB); if (hasA && !hasB) { v[0]++; } else if (hasB && !hasA) { v[1]++; } else if (hasA && hasB) { v[2]++; } else {v[3]++;} } } for (auto x: v) { int val = 100*x/4; cout << val << " "; } cout << endl; return 0; }