結果

問題 No.1317 月曜日の朝、WAを出した
ユーザー tnakao0123tnakao0123
提出日時 2020-12-18 23:32:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 15 ms / 1,500 ms
コード長 1,184 bytes
コンパイル時間 766 ms
コンパイル使用メモリ 94,384 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 08:27:33
合計ジャッジ時間 1,315 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 15 ms
4,348 KB
testcase_02 AC 14 ms
4,348 KB
testcase_03 AC 14 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1317.cc:  No.1317 月曜日の朝、WAを出した - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int M = 6;
const char ss[M][8] = { "AC", "WA", "TLE", "MLE", "OLE", "RE" };
enum { AC, WA, TLE, MLE, OLE, RE };

/* typedef */

/* global variables */

int cs[2][M];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);

  while (n--) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < M; j++) scanf("%d", cs[i] + j);

    char s[8];
    scanf("%s", s);
    int x = 0;
    for (; strcmp(s, ss[x]) != 0; x++);
    //puts(ss[x]);

    int wsum = 0;
    for (int j = 1; j < M; j++) wsum += cs[0][j];

    bool ok = (cs[0][x] == 0);
    for (int j = 1; ok && j < M; j++)
      ok = (j == x && cs[1][j] >= wsum) || (j != x && cs[1][j] == 0);

    if (ok) puts("Yes");
    else puts("No");
  }

  return 0;
}
0