結果

問題 No.3279 Dhole vs Monster
ユーザー tnakao0123
提出日時 2025-09-27 15:21:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 41,556 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-27 15:21:10
合計ジャッジ時間 1,471 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:28:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   28 |   scanf("%d%s", &l, s), l--;
      |   ~~~~~^~~~~~~~~~~~~~~

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 3279.cc:  No.3279 Dhole vs Monster - yukicoder
 */

#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

/* constant */

const int MAX_L = 5;
const int ds[MAX_L] = { 390, 429, 468, 507, 546 };

/* typedef */

/* global variables */

/* subroutines */

/* main */

int main() {
  int l;
  char s[16];
  scanf("%d%s", &l, s), l--;

  int x = (s[0] == 'B') ? ds[l + 1] : ds[l];
  printf("%d\n", x);

  return 0;
}
0