TLE help!!
查看原帖
TLE help!!
1071426
shx2011楼主2025/2/5 11:27
#include<bits/stdc++.h>
using namespace std;
const int N=110;
string BFS[N];
void make(int n){
	BFS[0]="0";
	BFS[1]="1";
	for(int i=2;i<=n;i++){
		BFS[i]=BFS[i-1]+BFS[i-2];
	}
}

void print(int x,int y,string l){
	for(int i=x;i<=y;i++){
		cout<<l[i];
	}
	
	cout<<endl;
}
int t;
int main(){	
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>t;
	make(110);
	while(t--){
		int n,i,j;
		cin>>n>>i>>j;		
		string s=BFS[n];
		print(i,j,s);
	}
	return 0;
}

2025/2/5 11:27
加载中...