結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-12 04:23:47 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 324 bytes |
| コンパイル時間 | 594 ms |
| コンパイル使用メモリ | 20,992 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 06:44:03 |
| 合計ジャッジ時間 | 1,324 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s", N);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char N[101+1];
scanf("%s", N);
if (N[0] == '1') {
int i;
for (i = 1; N[i] == '3'; i++)
;
if (N[i] == '\0') {
printf("%d\n", i-1);
exit(0);
}
}
printf("-1\n");
}