結果
| 問題 |
No.2312 Turtleman and Gaming Console
|
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-17 11:46:13 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 427 ms |
| コンパイル使用メモリ | 25,216 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-17 11:46:15 |
| 合計ジャッジ時間 | 1,623 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",game);
| ^~~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s",machine);
| ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdbool.h>
void main(void){
int n = 0;
scanf("%d",&n);
char game[1000] = "a";
scanf("%s",game);
char machine[1000] = "b";
scanf("%s",machine);
bool playableFlg = false;
for(int i = 0 ; i < n ; i++ ){
if(game[i] == machine[i] && machine[i] == 'o'){
playableFlg = true;
}
}
if(playableFlg){
printf("Lucky Turtleman");
}else{
printf("Unlucky Turtleman");
}
}
Maeda