Blast It With Code_Blasters problems editorial

Hello coders, This is my second post on CodeChef discuss and the post contains solutions to our contest problems which we conducted in our college named Blast It With Code_Blasters on 31/10/2019. So if you found any mistakes do suggest me.

**Contest Link: ** https://www.codechef.com/BICB2019

1. Decorating Skills ( BICBSIM4)

Solution:
//coded by vishal mourya
#include<bits/stdc++.h>
using namespace std;
#define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(void){
fasthoja
ll t; cin>>t;
while(t–){
ll a,b,c,d;
cin>>a>>b>>c>>d;

    cout<< ( (a*b)/(c*d) )<<"\n";
}
return 0;

}

2. Simplicity at its best ( BICBSIM1)

Solution:
//coded by vishal mourya
#include<bits/stdc++.h>
using namespace std;
#define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(void){
fasthoja
ll t; cin>>t;
while(t–){
ll a,b;
cin>>a>>b;
cout<<a+b<<" “;
ll ans = a > b ? a - b : b - a;
cout<<ans<<” “;
cout<<a*b<<” “;
cout<<b/a<<” “;
cout<<”\n";
}
return 0;
}

3. Good Student help teachers ( BICBSIM3)

Solution:
//coded by vishal mourya
#include<bits/stdc++.h>
using namespace std;
#define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(void){
fasthoja

cout<<"The given number is a prime number.\n";
cout<<"The given number is not a Armstrong number.\n";
cout<<"The given number is a Pallindrome.\n";

cout<<"The given number is not a prime number.\n";
cout<<"The given number is not a Armstrong number.\n";
cout<<"The given number is not a Pallindrome.\n";

cout<<"The given number is a prime number.\n";
cout<<"The given number is not a Armstrong number.\n";
cout<<"The given number is a Pallindrome.\n";

cout<<"The given number is not a prime number.\n";
cout<<"The given number is not a Armstrong number.\n";
cout<<"The given number is not a Pallindrome.\n";

cout<<"The given number is not a prime number.\n";
cout<<"The given number is a Armstrong number.\n";
cout<<"The given number is not a Pallindrome.\n";


return 0;

}

4. Printing Pattern using loops ( BICBPAT1)

Solution:

Coded by Coder

n=int(input())
temp=n
flag=0
val=temp
for i in range(((n-1)*2)+1,0,-1):
tp=n
for l in range(n-temp):
print(tp,end=" “)
tp-=1
for j in range(0,((temp-1)*2)+1):
print(temp,end=” “)
for l in range(n-temp):
tp+=1
print(tp,end=” “)
print(”")
val=temp
if temp == 1:
flag=1
if flag != 0:
temp+=1
else:
temp-=1

5. Winter Vacation ( BICBTUF7)

Solution:
//coded by vishal mourya
#include<bits/stdc++.h>
using namespace std;
#define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(void){
fasthoja
cout<<1<<"\n";
return 0;
}

6. Helping Spy ( BICBSIM2)

Solution:
//coded by vishal mourya
#include<bits/stdc++.h>
using namespace std;
#define fasthoja ios_base::sync_with_stdio(false); cin.tie(NULL);
typedef long long int ll;
int main(void){
fasthoja
cout<<“D\n”<<“E\n”<<“A\n”<<“D\n”;
return 0;
}

Hoping to conduct more such contest in our college :slight_smile:

Thank You CodeChef for creating such a wonderful environment.

1 Like