結果
| 問題 | No.104 国道 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-07-20 17:13:11 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 5,000 ms |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 37,836 KB |
| 最終ジャッジ日時 | 2026-02-24 01:07:58 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
コンパイルメッセージ
main.c: In function 'main':
main.c:9:9: warning: 'gets' is deprecated [-Wdeprecated-declarations]
9 | gets(s);
| ^~~~
In file included from main.c:1:
/usr/include/stdio.h:667:14: note: declared here
667 | extern char *gets (char *__s) __wur __attribute_deprecated__;
| ^~~~
/usr/bin/ld: /tmp/ccszjvAz.o: in function `main':
main.c:(.text.startup+0xd): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include <stdio.h>
#include <stdlib.h>
int main() {
int n = 1, i = 0;
char s[30];
s[0] = '\0';
gets(s);
while (s[i] != '\0') {
n *= 2;
if (s[i] == 'R')
n++;
i++;
}
printf("%d\n", n);
return EXIT_SUCCESS;
}