結果
問題 |
No.932 解法破綻!高橋君
|
ユーザー |
![]() |
提出日時 | 2025-03-11 17:47:57 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 536 bytes |
コンパイル時間 | 405 ms |
コンパイル使用メモリ | 25,088 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-11 17:47:59 |
合計ジャッジ時間 | 1,779 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
コンパイルメッセージ
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); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> #include <stdbool.h> int main() { char str[1000000] = "a"; scanf("%s",str); char *ptr; // 最初のトークンを取得 ptr = strtok(str, ","); bool okFlg = true; // 2回目以降のトークンを取得 while (ptr != NULL) { if(strcmp(ptr,"AC") != 0){ okFlg = false; break; } ptr = strtok(NULL, ","); } if(okFlg){ printf("Done!"); }else{ printf("Failed..."); } return 0; }