結果
問題 | No.104 国道 |
ユーザー |
![]() |
提出日時 | 2018-03-29 21:33:35 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 202 ms |
コンパイル使用メモリ | 29,184 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-25 23:52:43 |
合計ジャッジ時間 | 932 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
コンパイルメッセージ
main.c: In function 'main': main.c:29:26: warning: comparison between pointer and integer 29 | while(lr[n]!=NULL){ | ^~
ソースコード
#include <stdio.h>int root(int n, char side[]){if(n==-1) return 1;if(side[n]=='L') return (root(n-1, side)*2);if(side[n]=='R') return (root(n-1, side)*2 + 1);}int main(void) {// your code goes hereint i, n=0;char now, lr[255]={};scanf("%s",lr);while(lr[n]!=NULL){n++;}n--;printf("%d",root(n, lr));return 0;}