結果
| 問題 |
No.2920 Blood Type
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-10-12 18:07:31 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 742 bytes |
| コンパイル時間 | 298 ms |
| コンパイル使用メモリ | 40,448 KB |
| 最終ジャッジ日時 | 2025-02-24 18:53:17 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 36 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:34:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
34 | scanf("%s%s", s, t);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 2920.cc: No.2920 Blood Type - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
enum { A, B, AB, O };
/* typedef */
/* global variables */
int ps[4];
/* subroutines */
int bt(char s, char t) {
if ((s == 'A' && t != 'B') || (t == 'A' && s != 'B')) return A;
if ((s == 'B' && t != 'A') || (t == 'B' && s != 'A')) return B;
if ((s == 'A' && t == 'B') || (t == 'A' && s == 'B')) return AB;
return O;
}
/* main */
int main() {
char s[8], t[8];
scanf("%s%s", s, t);
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++)
ps[bt(s[i], t[j])] += 25;
for (int i = 0; i < 4; i++)
printf("%d%c", ps[i], (i < 3) ? ' ' : '\n');
return 0;
}
tnakao0123