Skip to content

Instantly share code, notes, and snippets.

@dhavalpandey
Last active October 30, 2021 12:55
Show Gist options
  • Save dhavalpandey/b825211905c93097ad48abc141537f98 to your computer and use it in GitHub Desktop.
Save dhavalpandey/b825211905c93097ad48abc141537f98 to your computer and use it in GitHub Desktop.
Competitive Programming Template - Java
//=======================================================================================copy under=====================================================================//
import java.io.*;
import java.util.*;
class comp {
static final FastScanner fs = new FastScanner();
static int testCases;
public static void main(String[] args) {
testCases = fs.nextInt();
while (testCases-- > 0) {
solve();
}
}
public static void solve() {
//write code here
}
static final Random random = new Random();
public static void ruffleSort(int[] a) {
int n = a.length;
for (int i = 0; i < n; ++i) {
int oi = random.nextInt(n), temp = a[oi];
}
Arrays.sort(a);
}
static class FastScanner {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer("");
String next() {
while (!st.hasMoreTokens())
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment