結果

問題 No.730 アルファベットパネル
ユーザー Maeda
提出日時 2025-03-11 15:26:44
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 1,724 ms
コンパイル使用メモリ 25,216 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-11 15:26:47
合計ジャッジ時間 1,237 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     scanf("%s",str);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>
#include <stdbool.h>

void main(void){
    char str[100] = "a";
    scanf("%s",str);
    bool flg = true;
    for(int i = 0 ; i < (int)strlen(str);i++){
    	for(int j = i+1;j < (int)strlen(str);j++){
    		if(str[i] == str[j]){
    			flg = false;
    			break;
    		}
    	}
    	if(!flg){
    		break;
    	}
    }
    if(flg){
    	printf("YES");
    }else{
    	printf("NO");
    }
   
}
0