結果
| 問題 | No.331 CodeRunnerでやれ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-07-04 09:43:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1,692 ms / 5,000 ms |
| コード長 | 996 bytes |
| 記録 | |
| コンパイル時間 | 676 ms |
| コンパイル使用メモリ | 66,080 KB |
| 実行使用メモリ | 25,496 KB |
| 平均クエリ数 | 7266.00 |
| 最終ジャッジ日時 | 2024-07-16 17:17:13 |
| 合計ジャッジ時間 | 13,490 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 16 |
ソースコード
#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:
size_t n = s.size();
switch(n) {
case 8:
return 20151224U;
default:
int res = 0;
for(size_t i=0; i<n; ++i) {
res *= 10;
res += s[i] - '0';
}
return res;
}
}
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 << "LR"[xorshift32() % 2] << endl;
break;
default:
cout << "FFFLR"[xorshift32() % 5] << endl;
break;
}
}
return 0;
}