Answers for "fast io c++"

C++
3

fast io c++

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
Posted by: Guest on July-15-2021
0

fast io c++

#include <bits/stdc++.h>
using namespace std;

template <typename T> void in(T& x) // fast input
{
    x = 0; T f = 1;
    char ch = getchar();
    while (!isdigit(ch)) f = ch == '-' ? - f : f, ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
    x *= f;
}

template<typename T> void out(T n) //fast output
{ 
	bool neg = 0; 

	if (n < 0) 
		n *= -1, neg = 1; 

	char snum[20]; 
	int i = 0; 
	do
	{ 
		snum[i++] = n % 10 + '0'; 
		n /= 10; 
	} 

	while (n); 
	--i; 

	if (neg) 
		putchar('-'); 

	while (i >= 0) 
		putchar(snum[i--]); 

	putchar('\n'); 
} 

main() { //My Test
  	int n;
	in(n);
  	out(n);
}
Posted by: Guest on May-04-2021
0

fast io c++

fastio.pythonanywhere.com   
/* A tool to optimize execution time of C++ codes by replacing methods of
reading and writing variables */
Posted by: Guest on May-04-2021
0

fast io c++

#define FastIO ios_base::sync_with_stdio(false); cin.tie(NULL);
Posted by: Guest on April-01-2021

Browse Popular Code Answers by Language