結果
| 問題 | No.264 じゃんけん |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-30 15:24:06 |
| 言語 | TypeScript (6.0.2) |
| 結果 |
AC
|
| 実行時間 | 89 ms / 5,000 ms |
| コード長 | 610 bytes |
| 記録 | |
| コンパイル時間 | 4,657 ms |
| コンパイル使用メモリ | 349,684 KB |
| 実行使用メモリ | 52,968 KB |
| 最終ジャッジ日時 | 2026-06-05 04:32:07 |
| 合計ジャッジ時間 | 6,388 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
import { readFileSync } from 'fs';
function Main(input: string): void {
const data = input.split('\n');
const firstLine = data[0].split(' ');
const player1 = parseInt(firstLine[0]);
const player2 = parseInt(firstLine[1]);
if (player1 === player2) {
console.log('Drew');
return;
}
if (
(player1 === 0 && player2 === 1) || // グー vs チョキ
(player1 === 1 && player2 === 2) || // チョキ vs パー
(player1 === 2 && player2 === 0) // パー vs グー
) {
console.log('Won');
return;
}
console.log('Lost');
}
Main(readFileSync('/dev/stdin', 'utf8'));