結果
問題 | No.264 じゃんけん |
ユーザー |
|
提出日時 | 2020-07-30 15:24:06 |
言語 | TypeScript (5.7.2) |
結果 |
AC
|
実行時間 | 59 ms / 5,000 ms |
コード長 | 610 bytes |
コンパイル時間 | 8,149 ms |
コンパイル使用メモリ | 228,912 KB |
実行使用メモリ | 41,204 KB |
最終ジャッジ日時 | 2024-12-31 16:16:23 |
合計ジャッジ時間 | 8,823 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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'));