tamjedpeace's blog

By tamjedpeace, history, 9 years ago, In English

Can anyone tell me how can I start dp problem solving? Which resources and topic will help me to progress successfully?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By tamjedpeace, history, 9 years ago, In English

include<bits/stdc++.h>

using namespace std;

bool prime(long long a) { long long b=0,i; for(i=2; i*i<=a; i++) if(a%i==0) return 0; return 1; }

int main() { long long t,m,n; cin>>t; for(long long i=0; i<t; i++) { cin>>n>>m; for(long long j=n; j<=m; j++) { if(prime(j)==1&&j!=1) cout<<j<<endl; } cout <<endl; } return 0; }

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it