fast io c 2b 2b

Solutions on MaxInterview for fast io c 2b 2b by the best coders in the world

showing results for - "fast io c 2b 2b"
Vicente
26 Aug 2020
1#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
Carl
20 May 2017
1#include <bits/stdc++.h>
2using namespace std;
3
4template <typename T> void in(T& x) // fast input
5{
6    x = 0; T f = 1;
7    char ch = getchar();
8    while (!isdigit(ch)) f = ch == '-' ? - f : f, ch = getchar();
9    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
10    x *= f;
11}
12
13template<typename T> void out(T n) //fast output
14{ 
15	bool neg = 0; 
16
17	if (n < 0) 
18		n *= -1, neg = 1; 
19
20	char snum[20]; 
21	int i = 0; 
22	do
23	{ 
24		snum[i++] = n % 10 + '0'; 
25		n /= 10; 
26	} 
27
28	while (n); 
29	--i; 
30
31	if (neg) 
32		putchar('-'); 
33
34	while (i >= 0) 
35		putchar(snum[i--]); 
36
37	putchar('\n'); 
38} 
39
40main() { //My Test
41  	int n;
42	in(n);
43  	out(n);
44}
45
Oscar
14 Mar 2018
1fastio.pythonanywhere.com   
2/* A tool to optimize execution time of C++ codes by replacing methods of
3reading and writing variables */
Alberto
24 Mar 2018
1#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL);