結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2022-08-15 22:52:04 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 281 bytes |
コンパイル時間 | 1,262 ms |
コンパイル使用メモリ | 27,776 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-02 10:40:48 |
合計ジャッジ時間 | 1,110 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
#include <stdio.h> int main(void){ char s[1000]; s[0]='A'; scanf("%s",s); int ans = 1; if(s[0]=='A'){printf("1\n");return 0;} for(int i=0;s[i]!='\0';i++){ if(s[i]=='L'){ans = ans*2;} else{ans = ans*2+1;} } printf("%d\n",ans); }