-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ff56089
Showing
2,174 changed files
with
301,617 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.