Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CPPTemplate
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define ppb pop_back #define ss second #define ff first #define pii pair<int,int> //Constants const int mod= 1e9+7; const int MAX= 200005; //Functions int bipow(int a,int b) { int ans=1; while(b) { if(b&1)ans=(ans*1LL*a)%mod; a=(a*1LL*a)%mod; b>>=1; } return ans; } bool isPrime(int x) { if(x==1)return 0; else if(x==2 || x==3)return 1; if(x%2==0 ||x%3==0)return 0; for(int i=5;i*i<=x;i+=6) { if(x%i==0 || x%(i+2)==0)return 0; } return 1; } //factorial and inverse_factorial /* vector<int>fac(MAX),inv_fac(MAX); void Factorials() { inv_fac[0]=inv_fac[1]=fac[0]=fac[1]=1; for(int i=2;i<MAX;i++)fac[i]=(i*1LL*fac[i-1])%mod; for(int i=2;i<MAX;i++)inv_fac[i]=bipow(fac[i],mod-2); } */ //Sieve /* int sieve[MAX]; void Sieve(){sieve[1]=1;for(int i=2;i<MAX;i++)if(sieve[i]==0){for(int j=i;j<MAX;j+=i)sieve[j]=i;}} */ //Prime Generate /* vector<int>primes; void PrimeGen(){bool vis[MAX]={0};for(int i=2;i<MAX;i++)if(!vis[i]){primes.pb(i);for(int j=i;j<MAX;j+=i)vis[j]=1;}} */ typedef int MyCustomType; void solve() { } int main() { //Factorials(); //Sieve(); //PrimeGen(); ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int tc=1; cin>>tc; while(tc--) { solve(); } return 0; }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
edit mode
|
history
|
discussion