From ae38348d78ddde17e61bed5efd0565ccba046ce6 Mon Sep 17 00:00:00 2001 From: ramjeet saran Date: Fri, 21 Aug 2015 10:49:53 +0530 Subject: [PATCH] added crds,lastdig2,maxln,ololo --- Readme | 5 +++++ crds.cpp | 34 ++++++++++++++++++++++++++++++++++ lastdig2.cpp | 38 ++++++++++++++++++++++++++++++++++++++ maxln.cpp | 34 ++++++++++++++++++++++++++++++++++ ololo.cpp | 24 ++++++++++++++++++++++++ 5 files changed, 135 insertions(+) create mode 100644 crds.cpp create mode 100644 lastdig2.cpp create mode 100644 maxln.cpp create mode 100644 ololo.cpp diff --git a/Readme b/Readme index 2d87102..5c23891 100644 --- a/Readme +++ b/Readme @@ -37,3 +37,8 @@ http://www.spoj.com/users/raj94/ 32) NGM 33) BISHOPS 34) BEENUMS +35) OFFSIDE +36) CRDS +37) LASTDIG2 +38) MAXLN +39) OLOLO diff --git a/crds.cpp b/crds.cpp new file mode 100644 index 0000000..0ce5550 --- /dev/null +++ b/crds.cpp @@ -0,0 +1,34 @@ +//DATE: 20/08/2015 +//Author: Ramjeet Saran +//http://www.spoj.com/problems/CRDS/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +# define MAX(a,b) a>b ? a : b; +# define MIN(a,b) a>t; + while(t--){ + cin>>n; + lli ans = (3 * (( (n * (n - 1) ) / 2 ) % 1000007)) % 1000007; + ans = ans + ( 2 * n ) % 1000007 ; + cout< +#include +#include +#include +#include +#include + +int cycle[10] = {1,1,4,4,2,1,1,4,4,2}; + +using namespace std; + +int main(){ + string a; + long long int b; + int t; + cin>>t; + while(t--){ + cin>>a>>b; + int lenA = a.length(); + if(b == 0) + cout<<"1"< +#include +#include +#include +#include +#include +#include +#include +#include +#include + +# define MAX(a,b) a>b ? a : b; +# define MIN(a,b) a>t; + for(int i =1; i <= t; i++){ + cin>>n; + lli ans = 4 * n * n; + cout<<"Case "< +#include +#include +#include +#include +#include + +using namespace std; + +int main(){ + int N; + scanf("%d",&N); + long long int A, ans = 0; + while(N--){ + scanf("%ld",&A); + ans = ans ^ A; + } + printf("%ld\n",ans); + +}