結果
| 問題 | No.2920 Blood Type |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-08 20:49:58 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 53 ms / 2,000 ms |
| コード長 | 768 bytes |
| 記録 | |
| コンパイル時間 | 7,232 ms |
| コンパイル使用メモリ | 169,664 KB |
| 実行使用メモリ | 185,132 KB |
| 最終ジャッジ日時 | 2025-12-08 20:50:11 |
| 合計ジャッジ時間 | 10,514 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 36 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (99 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
class Program
{
static void Main()
{
string S = Console.ReadLine();
string T = Console.ReadLine();
int A = 0, B = 0, AB = 0, O = 0;
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 2; j++)
{
char s = S[i];
char t = T[j];
bool hasA = (s == 'A' || t == 'A');
bool hasB = (s == 'B' || t == 'B');
if (hasA && !hasB) A++;
else if (hasB && !hasA) B++;
else if (hasA && hasB) AB++;
else O++;
}
}
// 4 通りなので、カウント × 25 がそのまま [%]
Console.WriteLine($"{A*25} {B*25} {AB*25} {O*25}");
}
}