#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
Home / lightoj
Showing posts with label lightoj. Show all posts
Showing posts with label lightoj. Show all posts
LightOj 1043 Triangle Partitioning
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
#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
#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
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
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
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
#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
Subscribe to:
Posts
(
Atom
)