LightOj 1133 Array Simulation Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { int t,n,m,i,j,a[1000],b[1000],k,l,p; string s; //freo... Read More
LightOj 1043 Triangle Partitioning Add Comment Edit Hints: ADE/ABC=DE^2/BC^2 and AD/AB=DE/BC #include <bits/stdc++.h> using namespace std; int main() { int t,i,j; flo... Read More
LightOj 1116 Ekka Dokka Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { long long int l,m,t,w,y,z,h,x,p,q,n; //freopen("input... Read More
LightOj 1109 - False Ordering Add Comment Edit #include <bits/stdc++.h> using namespace std; #define n 1000005 bool a[n]; long long int k=1; long long int twin[n],i,j,t; bool... Read More
LightOj 1189 Sum of Factorials Add Comment Edit Hints: The highest number n is 10^18 . So highest factorial is 20! . So at first pre calculate factorials from 0 to 20. Then check fro... Read More
LightOj 1024 EID Add Comment Edit N:B :- Use Garbage Collector System.gc() after print to clear garbages and reduce memory size . import java.math.*; import java.util... Read More
LightOj 1179 Josephus Problem Add Comment Edit Tutorial : Josephus Problem #include <bits/stdc++.h> using namespace std; int lastman(int n,int k) { if(n==1) {... Read More
LightOj 1042 Secret Origins Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { long long int i,j,k,l,n,m,a[100000],d,b[100000],sum; ... Read More
LightOj 1414 February 29 Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { long long int d1,d2,y1,y2,i,j,k,l,n,t,x,y,z,u,w; strin... Read More
LightOj 1009 Back to Underworld Add Comment Edit Hints : Bipartite Approach. Just use two colors to mark Vampires and Lycans. Then find who are maximum . As graph may be disconnected... Read More
LightOj 1045 Digits Of Factorial Add Comment Edit Number Of Factorial Digits = log(n!)+1 . As n is very large for factorial so we can write as below log(5!)=log(5*4*3*2*1)=log1+log2+lo... Read More
LightOJ 1197 Help Hanzo Add Comment Edit Hints : Implement, Segmented Sieve Algorithm To Generate Prime Numbers. Here is a tutorial for segmented sieve #include <... Read More
LightOj 1354 IP Checking Add Comment Edit #include <bits/stdc++.h> using namespace std; long long int decimal(long long int x) { long long int sum=0,r,k=0; ... Read More
LightOJ 1107 How Cow Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { long long int x1,y1,x2,y2,t,a,b,i,j,m; cin>>t; ... Read More
LightOj 1053 Higher Math Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { long long int t,a,b,c,m,n,i,j,p,q,r; vector<long long... Read More
LightOJ 1214 Large Division Add Comment Edit Find Tutorial Here: Big Integer Remainder #include <bits/stdc++.h> using namespace std; int main() { string s; ... Read More
LightOj 1028 Trailing With Zeroes (I) Add Comment Edit At First Check Out This Tutorial on Finding Number Of Divisors #include <bits/stdc++.h> using namespace std; #define ... Read More
LightOj 1078 Integer Divisibility Add Comment Edit Hints: long long int can not contain such a big type of data as there may be 10^6 digit. string or char data type can contain bu... Read More
LightOj 1212 Double Ended Queue Add Comment Edit #include <bits/stdc++.h> using namespace std; int main() { deque<int>dq; int t,n,m,i,j,p,r,c; string s... Read More
LightOj-1069 Lift Add Comment Edit #include <stdio.h> int main() { int t,a,b,e,o,i,f,r,g,s,d; scanf("%d",&t); for(i=1;i<=t;i++) { ... Read More