結果

問題 No.661 ハローキティはりんご3個分
ユーザー seaside0002seaside0002
提出日時 2020-01-02 19:02:38
言語 PHP
(8.2.11)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 786 ms
コンパイル使用メモリ 12,036 KB
実行使用メモリ 10,544 KB
最終ジャッジ日時 2023-08-14 18:36:42
合計ジャッジ時間 1,428 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
10,540 KB
testcase_01 AC 7 ms
10,472 KB
testcase_02 AC 7 ms
10,476 KB
testcase_03 AC 7 ms
10,456 KB
testcase_04 AC 7 ms
10,544 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$n = trim(fgets(STDIN));
$weight;

for($i = 0; $i < $n; $i++){
	$weight[$i] = trim(fgets(STDIN)); 
}

foreach($weight as $value){
	echo kitty($value)."\n";
}


function kitty($value){
	$ans;
	
	if($value % 8 == 0){
		$ans = 'iki';
		if($value % 10 == 0){
			$ans .= 'sugi';
		}
	}else if($value % 10 == 0){
		$ans = 'sugi';
	}else{
		$ans = $value / 3;
	}
	
	return $ans;
}
0