Skip to content

Commit

Permalink
First Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
deecoders committed Feb 5, 2019
0 parents commit ff56089
Show file tree
Hide file tree
Showing 2,174 changed files with 301,617 additions and 0 deletions.
Binary file added MCA_Result.ods
Binary file not shown.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#SprintOJ
A fully automated Online-Judge to check codes of admin-uploadable questions written in the user choice's language.
Backend written in NodeJS and frontend in AngularJS.

##How to setup:

Just clone this repo.
In the cloned repo's folder, type:
```
node server.js
```
Goto http://localhost:3000/

And you're up :)

##Prerequisites:

NodeJS
(To install NodeJS type:)
```
sudo apt-get install nodejs
```
19 changes: 19 additions & 0 deletions bash/bash_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
if [ $3==".c" ]; then
gcc temp/$4 -o $2
a="testcases/"
b=$a$1
c=$b"/"
#echo $b
#echo $c
n=3
d=$c"in_"
e=$d$2
f=$c"out_"
g=$f$2
h="temp"$2
./$2 < $e > $h
# echo $2
diff $h $g | wc -l
rm $2 $h
fi
77 changes: 77 additions & 0 deletions bash/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
if [ $3 == ".cpp" ]; then
g++ ./temp/code.cpp -std=c++11 -o $2
a="./testcases/"
b=$a$1
c=$b"/"
#./testcases/1/
n=3
#for ((i=1; i<=$n; i++))
#do
d=$c"in_"
e=$d$2
f=$c"out_"
g=$f$2
h="temp"$2
./$2 < $e > $h
echo $2
diff $h $g | wc -l
#done
rm $2 $h
fi
if [ $3 == ".c" ]; then
gcc ./temp/code.c -o $2
a="./testcases/"
b=$a$1
c=$b"/"
#./testcases/1/
n=3
#for ((i=1; i<=$n; i++))
#do
d=$c"in_"
e=$d$2
f=$c"out_"
g=$f$2
h="temp"$2
./$2 < $e > $h
echo $2
diff $h $g | wc -l
#done
rm $2 $h
fi

if [ $3 == ".py" ]; then
a="./testcases/"
b=$a$1
c=$b"/"
#./testcases/1/
n=3
#for ((i=1; i<=$n; i++))
#do
d=$c"in_"
e=$d$2
f=$c"out_"
g=$f$2
h="temp"$2
python ./temp/code.py < $e > $h
echo $2
diff $h $g | wc -l
rm $2 $h
fi
if [ $3 == ".py" ]; then
a="./testcases/"
b=$a$1
c=$b"/"
#./testcases/1/
n=3
#for ((i=1; i<=$n; i++))
#do
d=$c"in_"
e=$d$2
f=$c"out_"
g=$f$2
h="temp"$2
java ./temp/code.java < $e > $h
echo $2
diff $h $g | wc -l
rm $2 $h
fi
43 changes: 43 additions & 0 deletions bash/script2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

if [$2 -eq ""]
then
a="./view/questions/"$1
aa="./testcases/"$1
mkdir $aa
mkdir $a
cp "./view/questions/power/alert.png" "./view/questions/power/greenTick.jpg" "./view/questions/power/na.png" "./view/questions/power/redCross.png" $a

n=3

for ((i=1; i<=$n; i++))
do
g="./testcases/"$1
b=$g"/in_"
c=$b$i
d=$g"/out_"
e=$d$i

touch $c $e
done

else
a="./view/contests/"$2
aa="./testcases/"$2
mkdir $aa
mkdir $a
cp "./view/questions/power/alert.png" "./view/questions/power/greenTick.jpg" "./view/questions/power/na.png" "./view/questions/power/redCross.png" $a

n=3

for ((i=1; i<=$n; i++))
do
g="./testcases/"$2
b=$g"/in_"
c=$b$i
d=$g"/out_"
e=$d$i

touch $c $e
done
fi
40 changes: 40 additions & 0 deletions code.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

typedef long long int LL;

#define din(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define llin(n) scanf("%lld",&n)
#define llout(n) printf("%lld\n",n)
#define strin(n) scanf(" %s",n)
#define strout(n) printf("%s\n",n)

int mod=1000000007;

long long po(long long x, long long y)
{
long long pro=1;
while(y>0)
{
if(mod==1)
return(0);
else if(y&1 != 0)
pro=((pro%mod)*(x%mod))%mod;
x=(x*x)%mod;
y=y>>1;
}
return pro;
}

int main(void)
{
long long a,b;
llin(a);
llin(b);
long long ans = po(a,b);
llout(ans);
return(0);
}
40 changes: 40 additions & 0 deletions codes/20152017.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

typedef long long int LL;

#define din(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define llin(n) scanf("%lld",&n)
#define llout(n) printf("%lld\n",n)
#define strin(n) scanf(" %s",n)
#define strout(n) printf("%s\n",n)

int mod=1000000007;

long long po(long long x, long long y)
{
long long pro=1;
while(y>0)
{
if(mod==1)
return(0);
else if(y&1 != 0)
pro=((pro%mod)*(x%mod))%mod;
x=(x*x)%mod;
y=y>>1;
}
return pro;
}

int main(void)
{
long long a,b;
llin(a);
llin(b);
long long ans = po(a,b);
llout(ans);
return(0);
}
12 changes: 12 additions & 0 deletions codes/20158026.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include<bits/stdc++.h>
using namespace std;

int main(){
int n,ans=1;
cin>>n;
for(int i=0;i<n;i++){
ans*=8;
}
cout<<ans%10;
return 0;
}
Binary file added codes/a.out
Binary file not shown.
31 changes: 31 additions & 0 deletions codes/code
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <stdio.h>

int power(int x, unsigned int y, int p)
{
int res = 1; // Initialize result

x = x % p; // Update x if it is more than or
// equal to p

while (y > 0)
{
// If y is odd, multiply x with result
if (y & 1)
res = (res*x) % p;

// y must be even now
y = y>>1; // y = y/2
x = (x*x) % p;
}
return res;
}

// Driver program to test above functions
int main()
{
int x,y,p;
scanf("%d%d",&x,&y);
p = 1000000007;
printf("%u\n", power(x, y, p));
return 0;
}
40 changes: 40 additions & 0 deletions codes/code.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

typedef long long int LL;

#define din(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define llin(n) scanf("%lld",&n)
#define llout(n) printf("%lld\n",n)
#define strin(n) scanf(" %s",n)
#define strout(n) printf("%s\n",n)

int mod=1000000007;

long long po(long long x, long long y)
{
long long pro=1;
while(y>0)
{
if(mod==1)
return(0);
else if(y&1 != 0)
pro=((pro%mod)*(x%mod))%mod;
x=(x*x)%mod;
y=y>>1;
}
return pro;
}

int main(void)
{
long long a,b;
llin(a);
llin(b);
long long ans = po(a,b);
llout(ans);
return(0);
}
40 changes: 40 additions & 0 deletions codes/code.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

typedef long long int LL;

#define din(n) scanf("%d",&n)
#define dout(n) printf("%d\n",n)
#define llin(n) scanf("%lld",&n)
#define llout(n) printf("%lld\n",n)
#define strin(n) scanf(" %s",n)
#define strout(n) printf("%s\n",n)

int mod=1000000007;

long long po(long long x, long long y)
{
long long pro=1;
while(y>0)
{
if(mod==1)
return(0);
else if(y&1 != 0)
pro=((pro%mod)*(x%mod))%mod;
x=(x*x)%mod;
y=y>>1;
}
return pro;
}

int main(void)
{
long long a,b;
llin(a);
llin(b);
long long ans = po(a,b);
llout(ans);
return(0);
}
Loading

0 comments on commit ff56089

Please sign in to comment.