結果
問題 | No.104 国道 |
ユーザー |
|
提出日時 | 2021-07-20 17:06:44 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 220 bytes |
コンパイル時間 | 169 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-17 13:43:58 |
合計ジャッジ時間 | 1,040 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s", s); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main() { int n = 1, i = 0; char s[30]; scanf("%s", s); while (s[i] != '\0') { n *= 2; if (s[i] == 'R') n++; i++; } printf("%d\n", n); return EXIT_SUCCESS; }