File tree Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Expand file tree Collapse file tree 3 files changed +104
-0
lines changed Original file line number Diff line number Diff line change @@ -32,3 +32,9 @@ Below is a brief description of the files:
32
32
33
33
* timer.cpp
34
34
> It contains a small code snippet to print the time taken by the program to execute the given test case data.
35
+
36
+ * java_template.java
37
+ > It conatins the code template for java solutions.
38
+
39
+ * python_template.py
40
+ > It conatins the code template for python solutions.
Original file line number Diff line number Diff line change
1
+ import java .io .*;
2
+ import java .util .*;
3
+ import java .math .*;
4
+
5
+ public class Main {
6
+ public static void main (String [] args ) throws Exception {
7
+ InputStream inputStream = System .in ;
8
+ OutputStream outputStream = System .out ;
9
+ InputReader in = new InputReader (inputStream );
10
+ PrintWriter out = new PrintWriter (outputStream );
11
+ Task solver = new Task ();
12
+ int tesCases = in .nextInt ();
13
+ for (int test = 1 ; test <= tesCases ; test += 1 ) {
14
+ solver .solve (test , in , out );
15
+ }
16
+ out .close ();
17
+ }
18
+
19
+ static class Task {
20
+ static final int MOD = (int ) (1e9 + 7 );
21
+
22
+ public void solve (int testNumber , InputReader in , PrintWriter out ) {
23
+ //Your code goes below
24
+
25
+ }
26
+ }
27
+
28
+ static class InputReader {
29
+ public BufferedReader take ;
30
+ public StringTokenizer split ;
31
+ public InputReader (InputStream stream ) {
32
+ take = new BufferedReader (new InputStreamReader (stream ), 10000000 );
33
+ split = null ;
34
+ }
35
+ public String next () {
36
+ while (split == null || !split .hasMoreTokens ()) {
37
+ try {
38
+ split = new StringTokenizer (take .readLine ());
39
+ }
40
+ catch (IOException e ) {
41
+ throw new RuntimeException (e );
42
+ }
43
+ }
44
+ return split .nextToken ();
45
+ }
46
+ public int nextInt () {
47
+ return Integer .parseInt (next ());
48
+ }
49
+ }
50
+ }
Original file line number Diff line number Diff line change
1
+ #AUTHOR : BHUVNESH JAIN
2
+ #INSTITUTION : BITS, PILANI
3
+
4
+ MAX = 100005
5
+ MOD = 1000000007
6
+ def add (a ,b ,c ):
7
+ res = a + b
8
+ if (res >= c ):
9
+ return res - c
10
+ else :
11
+ return res
12
+
13
+ def mod (a ,b ,c ):
14
+ res = a * b
15
+ if (res >= c ):
16
+ return res % c
17
+ else :
18
+ return res
19
+
20
+ def gcd (a ,b ):
21
+ while b :
22
+ a ,b = b ,a % b
23
+ return a
24
+
25
+ def lcm (a ,b ):
26
+ w = a // gcd (a ,b )
27
+ return w * b
28
+
29
+ def expo (a ,b ):
30
+ x ,y = 1 ,a
31
+ while (b > 0 ):
32
+ if (b & 1 ):
33
+ x = x * y
34
+ y = y * y
35
+ b >>= 1
36
+ return x
37
+
38
+ def power (a ,b ,m ):
39
+ x ,y = 1 ,
40
+ while (b > 0 ):
41
+ if (b & 1 ):
42
+ x = mod (x ,y ,m )
43
+ y = mod (y ,y ,m )
44
+ b >>= 1
45
+ return x
46
+
47
+ if __name__ == "__main__" :
48
+ #code goes below79
You can’t perform that action at this time.
0 commit comments