結果

問題 No.331 CodeRunnerでやれ
ユーザー yuppe19 😺
提出日時 2019-07-04 09:30:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 856 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 64,896 KB
実行使用メモリ 87,776 KB
平均クエリ数 9076.65
最終ジャッジ日時 2024-07-16 17:15:03
合計ジャッジ時間 19,321 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

using u32 = uint32_t;

u32 uy = u32(time(NULL));
u32 xorshift32() {
  uy ^= uy << 14;
  uy ^= uy >> 13;
  uy ^= uy << 15;
  return uy;
}

inline u32 myhash(const string &s) {
  switch(s[0]) {
    case 'M':
      return 987'654'321U;
    default:
      switch(s.size()) {
        case 8:
          return 20151224U;
        default:
          return stoi(s);
      }
  }
  return -1;
}

int main(void) {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  string s;
  for(;;) {
    getline(cin, s);
    switch(myhash(s)) {
      case 987'654'321U:
        return 0;
      case 20151224:
        cout << 'F' << endl;
        break;
      case 0:
        cout << "FLR"[xorshift32() % 2 + 1] << endl;
        break;
      default:
        cout << "FLR"[xorshift32() % 3] << endl;
        break;
    }
  }
  return 0;
}
0