結果

問題 No.392 2分木をたどれ
ユーザー vjudge1
提出日時 2025-04-22 21:30:27
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 2,095 ms
コンパイル使用メモリ 191,712 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-04-22 21:30:30
合計ジャッジ時間 2,677 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 scanf("%lld",&n);
      |                 ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
int t,n,cnt;
char c[12345];
signed main(){
//	freopen("path.in","r",stdin);
//	freopen("path.out","w",stdout);
	cin>>t;
	while(t--){
		cnt=0;
		scanf("%lld",&n);
		while(n){
			c[++cnt]=(n%2==0?'R':'L');
			n=(n-1)/2;
		}
		for(int i=cnt;i>=1;i--)printf("%c",c[i]);
		printf("\n");
	}
	return 0;
}
0