Last active
October 30, 2021 12:55
-
-
Save dhavalpandey/b825211905c93097ad48abc141537f98 to your computer and use it in GitHub Desktop.
Competitive Programming Template - Java
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
//=======================================================================================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