akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    ld d,t,s;
    cin >> d >> t >> s;

    cout << (d/s <= t ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 3732
from collections import Counter
MOD = 2019
S = input()[::-1]
X = [0]
for i in range(len(S)):
    X.append((X[-1]+int(S[i])*pow(10, i, MOD))%MOD)
C = Counter(X)
ans = 0
for v in C.values():
    ans += v*(v-1)//2
print(ans)

Measured memory_bytes: 86932
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<math.h>

using namespace std;

typedef long long int lli;

int main() {
	int w, n;
	cin >> w >> n;
	vector<int> ar(w);
	vector<vector<int> > hor(n,vector<int>(2));
	for (int i = 0; i < w; i++) ar[i] += i+1;
	for (int j = 0; j < n;j++) {
		(cin >> hor[j][0]).ignore(1) >> hor[j][1];
		swap(ar[hor[j][0]-1], ar[hor[j][1]-1]);
	}
	for (int i = 0; i < w; i++) cout << ar[i] << endl;
	return 0;
}

Measured memory_bytes: 3108
/************************************************
*Author        :  lrj124
*Created Time  :  2018.12.02.20:27
*Mail          :  1584634848@qq.com
*Problem       :  d
************************************************/
#include <bits/stdc++.h>
using namespace std;
int n,cnt[101],ans;
inline void calc(int now) {
	for (int i = 2;i <= now;i++)
		while (!(now%i)) {
			now /= i;
			cnt[i]++;
		}
}
int main() {
	scanf("%d",&n);
	for (int i = 1;i <= n;i++) calc(i);
	for (int i = 1;i <= 100;i++) ans += cnt[i]>73;
	for (int i = 1;i <= 100;i++)
		for (int j = i+1;j <= 100;j++)
			ans += cnt[i]>1&&cnt[j]>23,
			ans += cnt[i]>23&&cnt[j]>1,
			ans += cnt[i]>3&&cnt[j]>13,
			ans += cnt[i]>13&&cnt[j]>3;
	for (int i = 1;i <= 100;i++)
		for (int j = i+1;j <= 100;j++)
			for (int k = j+1;k <= 100;k++)
				ans += cnt[i]>1&&cnt[j]>3&&cnt[k]>3,
				ans += cnt[i]>3&&cnt[j]>1&&cnt[k]>3,
				ans += cnt[i]>3&&cnt[j]>3&&cnt[k]>1;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll n; cin>>n;

    ll ans = INF;
    for(ll i=1; i*i<=n; i++){
        if(n % i == 0){
            chmin(ans, i + (n / i) - 2);
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main ()
{int b,c,i;
char a[110];

scanf("%s",a);
b=strlen(a);

if(b%2==0)
{
for(i=0;i<b/2;i++)
{
	if(a[i]!=a[b-i-1])
	c++;
}
}
else  if(b%2==1)

{
for(i=0;i<=(b-3)/2;i++)

{
	if(a[i]!=a[b-i-1])
	c++;
}
}
printf("%d\n",c);
return 0;
}

Measured memory_bytes: 128
#define rep(i, m, n) for(int i = m; i < n; i++)
#define repM(i, m, n) for(int i = n-1; i>=m; i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll; using namespace std;
//typedef pair<int,int> pii;
// d = distance(lower_bound(all(x)), upper_bound(all(x)));
int INF = 1e9;
int M = 1e9+7;
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <queue>

int main(){
  int N; cin >> N; if (N==1) {cout << 0 << endl; return 0;}
  int h[N]; for(int i=0; i<N; i++) cin >> h[i];
  int a=0; int dp[N]; dp[N-1] = 0;
  for(int i=N-2; i>=0; i--) {
    if (h[i] >= h[i+1]) dp[i]=dp[i+1]+1; else dp[i]=0;
    a = max(a, dp[i]);
  }
  cout << a << endl;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;

/*
int N;
int A[210];         // 最大 200 個なので余裕を持って 210 に --- 200 以上ならなんでもよいです

int main() {
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> A[i];

    int res = 0;
*/

int main(){

    int N[10];
    int sum=0;

for(int i=0;i<3;i++) {

  cin >> N[i];
  sum+=N[i];
  //cout << N[i];
}

if(sum>=22){
  cout << "bust"<< endl;

}
else{
  cout <<"win"<< endl;
}


    //cout << res << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  if (a % 2 == 0) {
    cout << "Even" << endl;
  }
  else if (b % 2 == 0) {
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;
  }
  
}

Measured memory_bytes: 256
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
ans = (v[0]+v[1])/2
count = 0
for i in range(2,n):
    count=(ans+v[i])/2
    ans = count
if n <=2:
    print(sum(v)/2)
else:
    print(count)

Measured memory_bytes: 3060
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


using i64 = ::std::int_fast64_t;
using u64 = ::std::uint_fast64_t;
using i32 = ::std::int_fast32_t;
using u32 = ::std::uint_fast32_t;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N;
  std::cin >> N;
  std::vector<i64> A;
  tools::read(A, N);

  std::sort(A.begin(), A.end(), std::greater<i64>());

  i64 answer = 0;
  for (i64 i = 1; i < N; ++i) {
    answer += A[i / 2];
  }

  std::cout << answer << std::endl;
  return 0;
}

Measured memory_bytes: 4824
#include <bits/stdc++.h>
using namespace std;

int main(){
    int a,b;
    cin>>a>>b;
    int i;
    
    for(i=1;i<=1250;i++){
    	if(i*0.08>=a&&i*0.08<a+1&&i*0.1>=b&&i*0.1<b+1){
    		cout<<i;
    		return 0;
		}
	}
	cout<<"-1";
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using ll = long long;

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)

using namespace std;

//long C(long n, long r);
//long long gcd(long long a, long long b);
//long long lcm(long long a, long long b);
 

void solve() {
    int N;
    cin >> N;
    if(N/10 == 9 || N % 10 == 9){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}
 
int main() {
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

vector<int> G[100010];
int dp[100010];
void dfs(int v){
	vector<int> vec;
	for(int u: G[v]){
		dfs(u);
		vec.pb(dp[u]);
	}
	sor(vec);
	rev(vec);
	dp[v] = vec.size();
	rep(i,vec.size()){
		dp[v] = max( dp[v] , vec[i]+i+1 );
	}
}

int main(){
	static int n;
	static int a[100010];
	scanf("%d",&n);
	for(int i = 2 ; i <= n ; i ++){
		scanf("%d",&a[i]);
		G[a[i]].pb(i);
	}
	dfs(1);
	cout << dp[1] << endl;
}


Measured memory_bytes: 14336
#include <bits/stdc++.h>
using namespace std;


void solve(std::string S, std::string T){
    int cnt = 0;
    for (int i=0; i<S.size(); i++) {
        cnt += (S[i] != T[i]);
    }
    printf("%d\n", cnt);
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}

Measured memory_bytes: 4220
S, T = gets.chomp, gets.chomp

I = [nil]*('z'.ord-'a'.ord+1)
IS = [nil]*S.size
S.chars.reverse_each.with_index{|c,i|
	c, i = c.ord-'a'.ord, S.size-1-i
	IS[i], I[c] = I[c], i
}

ICache = [nil]*('z'.ord-'a'.ord+1)
p T.each_char.inject([0,0]){|acc,c|
	id, im, c = *acc, c.ord-'a'.ord
	ic = (ICache[c]&&ICache[c]<=im) ? ICache[c] : I[c]
	break [0,-1] unless ic
	ic = IS[ic] while ic && ic < im
	if ic.nil?
		id += 1
		ic = I[c]
	end
	ICache[c] = ic
	next [id, ic+1]
}.tap{|a,b| break a*S.size+b }


Measured memory_bytes: 10364
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); i++)


int main(void) {
    
    string s;
    cin >> s;

    string d[4] = {"dream", "dreamer", "erase", "eraser"};
    
    reverse(s.begin(), s.end());
    rep(i,4)reverse(d[i].begin(), d[i].end());

    bool flag1 = true;
    for(int i = 0; i < s.size();){
        bool flag2 = false;
        for(int j = 0; j < 4; j++){
            string tmp = d[j];
            if(s.substr(i,tmp.size())==tmp){
                flag2 = true;
                i += tmp.size();
            }
        }

        if(!flag2){
            flag1 = false;
            break;
        }
    }

    if(flag1){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;

    
}

Measured memory_bytes: 512
X,Y=map(int,input().split())
mod=10**9+7

if (2*Y-X)%3!=0 or (2*X-Y)%3!=0:
  print(0)
  exit()

p,q=(2*Y-X)//3,(2*X-Y)//3

def cmb(n,r,mod):
    if (r<0 or r>n):
      return 0
    r=min(r,n-r)
    return g1[n]*g2[r]*g2[n-r]%mod

g1=[1,1]
g2=[1,1]
inverse=[0,1]

for i in range(2,10**6+1):
    g1.append((g1[-1]*i)%mod)
    inverse.append((-inverse[mod%i]*(mod//i))%mod)
    g2.append((g2[-1]*inverse[-1])%mod)

print(cmb(p+q,p,mod))

Measured memory_bytes: 122048
#include <bits/stdc++.h>

using namespace std ;
#define int long long int

const int maxn = 100;
const int maxw = 1e5 + 5;
const int inf = 1e16;
vector< vector<int> > dp(maxn, vector<int>(maxw, -1));
vector<int> w(maxn);
vector<int> v(maxn);
int n , W;

int cnt = 0 ;

int solve(int i , int value){
    if(i >= n || value <= 0){
        if(value == 0) return 0;
        else return inf;
    }
    int &ans = dp[i][value];
    if(ans != -1) return ans;
    ans = solve(i+1, value);
    ans = min(ans, w[i] + solve(i+1, value- v[i]));
    return ans;
}

int32_t main(){
    // #ifndef ONLINE_JUDGE
    //   freopen("input.txt", "r", stdin);
    //   freopen("output.txt", "w", stdout);
    // #endif
    cin >> n >> W ;
    for(int i = 0 ; i < n ; i++ ) {
        cin >> w[i] >> v[i];
    }
    int ans = 0;
    for(int i = 1 ; i <= 1e5; i++){
        int weigth  = solve(0, i);
        if(weigth <= W) {
            ans = i;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 80624
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int main(void){
    
    char s[3];
    const char a[] = "A";
    const char b[] = "B";
    
    cin >> s;
    
    if ( strstr(s,a) && strstr(s,b) ) {
        cout << "Yes" << endl;   
    } else {
    	cout << "No" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;

int main(){
    string S;
    cin >> S;

    int size = S.size();
    bool f = true;
    if(size%2 != 0) f = false;
    rep(i,size){
        if(i%2 == 0){
            if(S[i] != 'h'){
                f = false;
            }
        }else{
            if(S[i] != 'i'){
                f = false;
            }
        }
    }
    if(f) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=300005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    while(1){
        int N;cin>>N;
        if(N==0) break;
        string S;cin>>S;
        int M=int(S.size());
        int maxi=-1,cnt=0;
        vector<int> ans;
        
        for(int bit=0;bit<(1<<(M-1));bit++){
            int now=0;
            int sum=0;
            vector<int> use;
            for(int i=0;i<M;i++){
                now*=10;
                now+=S[i]-'0';
                
                if(!(bit&(1<<i))){
                    sum+=now;
                    use.push_back(now);
                    now=0;
                }
            }
            
            if(sum<=N){
                if(sum==maxi) cnt++;
                else if(sum>maxi){
                    maxi=sum;
                    cnt=1;
                    ans=use;
                }
            }
        }
        
        if(maxi==-1) cout<<"error"<<endl;
        else if(cnt>=2) cout<<"rejected"<<endl;
        else{
            cout<<maxi;
            for(int a:ans) cout<<" "<<a;
            cout<<endl;
        }
    }
}




Measured memory_bytes: 3176
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<ll> a(N);
  rep(i,N)
  {
    cin >> a[i];
  }
  ll sum = 0;
  rep(i,N)
  {
    sum += a[i];
  }
  ll m = 1000000000;
  ll sum2 = 0;
  if(N==2)
  {
    cout << abs(a[0]-a[1]);
    return 0;
  }
  for(int i=0;i<N;i++)
  {
    if(i!=N-1)
    {
      sum2 += a[i];
    }
    else
    {
      continue;
    }
    m = min(m,abs(sum-2*sum2));
  }
  cout << m << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
	ios::sync_with_stdio(false);cin.tie(0);
	
	long double a, b;
	cin >> a >> b;

	cout << (ll)(a * b + 0.0001) << endl;

	return 0;
}


Measured memory_bytes: 3808
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
typedef pair<ll, ll> pair_t;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
/****** define constant end ********/
/****** define variable start ******/
ll r;
/******* define variable end *******/
int solve() {
	cin >> r;
	cout << 2 * PI * r << endl;
	return 0;
}

int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 3804
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int A[] = new int[N];
    int x[][] = new int [N][N];
    int y[][] = new int [N][N];

    for (int i = 0; i < N; i++) {
      A[i] = Integer.parseInt(sc.next());
      for (int j = 0; j < A[i]; j++) {
        x[i][j] = Integer.parseInt(sc.next());
        y[i][j] = Integer.parseInt(sc.next());
      }
    }

    int twoPowN = 1;
    for (int i = 0; i < N; i++) {
      twoPowN *= 2;
    }

    boolean flag = true;
    int count = 0;
    int max = 0;
    for (int i = 1; i < twoPowN; i++) {
      String bin = Integer.toBinaryString(i);
      while (bin.length() < N) {
        bin = "0" + bin;
      }

      for (int j = 0; j < N; j++) {
        if (bin.charAt(bin.length() - j - 1) == '1') {
          for (int k = 0; k < A[j]; k++) {
            if (y[j][k] != bin.charAt(bin.length() - x[j][k]) - '0'){
              flag = false;
              break;
            }
          }
          count++;
        }
      }

      if (flag) {
        if (count > max) {
          max = count;
        }
      }

      flag = true;
      count = 0;
    }

    System.out.println(max);
  }
}


Measured memory_bytes: 29736
#include<bits/stdc++.h>
using namespace std;

#define ll long long



void solve(){
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    cout<<char(s1[0]-32)<<char(s2[0]-32)<<char(s3[0]-32)<<endl;
}

signed main(){
    //while(1)
    solve();
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

int main()
{
  int N;
  cin >> N;
  typedef long long ll;
  ll T, A;
  cin >> T >> A;
  ll t = T, a = A;
  for (int i = 1; i < N; ++i)
  {
    cin >> T >> A;
    ll m = t/T + ((0 == t%T) ? 0 : 1);
    ll n = a/A + ((0 == a%A) ? 0 : 1);
    ll j = ((m < n) ? n : m);
    t = j*T;
    a = j*A;
  }
  cout << t + a;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <queue>
using namespace std;
 
int main() {
	map<string, priority_queue<int,vector<int>,greater<int> > > index;
	string word;
	int page;
 
	while(cin>>word>>page){
		index[word].push(page);
	}
 
	for(multimap<string,priority_queue<int,vector<int>,greater<int> > >::iterator it = index.begin(); it != index.end(); ++it){
		cout << it->first << endl;
 
		priority_queue<int,vector<int>,greater<int> > temp = it->second;
		while(1){
			cout << temp.top();
			temp.pop();
			if(!temp.empty()){cout<<" ";continue;}
			break;
		}
		cout << endl;
 	}
 
	return 0;
}

Measured memory_bytes: 1244
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    string s;
    cin >> s;
    int ans = 1;
    string pre;
    string t;
    pre.push_back(s[0]);
    for(int i = 1; i < s.size(); i++){
        t.push_back(s[i]);
        if(pre != t){
            pre = t;
            t = "";
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
namespace mydef {
const int INF = 1ll << 60;
const int MOD = 1e9 + 7;
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
bool dbg = false;
}  // namespace mydef
using namespace mydef;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<pair<int, int>>
#define vvp vector<vector<pair<int, int>>>
#define pi pair<int, int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define asn ans


void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int D, T, S;
    cin >> D >> T >> S;
    Yes(D <= T * S);

    solve();
    return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;

#define int           long long
#define S             second
#define F             first
#define pb            push_back
#define all(c)        (c).begin(),(c).end()
#define rall(c)       (c).rbegin(),(c).rend() 
#define lb            lower_bound
#define si(c)         (int)((c).size())
#define lcm(a, b)      (a * (b / __gcd(a,b)))  
#define inf           (long long)(1e15)
#define endl          '\n'
#define mp            make_pair
#define time(s)       (double(clock()-s)/double(CLOCKS_PER_SEC))
#define debug(args...)    _F(#args, args)
#define vi            std::vector<int>
#define pii           pair<int, int> 
#define vpi           vector<pii>

clock_t start;
mt19937_64 rng(chrono::system_clock::now().time_since_epoch().count());

template<typename T> void _F(const char *name, T arg1){
    cerr << name << " = " << arg1 << endl;
}template<typename T, typename... Args> void _F(const char *names, T arg1, Args... args){
    const char *name = strchr(names, ',');
    cerr.write(names, name-names) << " = " << arg1 << endl;
    _F(name+2, args...);
}
template<typename T1, typename T2> istream& operator>>(istream& in, pair<T1, T2> &q){
    in >> q.F >> q.S; return in;
}template<typename T1, typename T2> ostream& operator<<(ostream& out, pair<T1, T2> &q){
    out << q.F << " " << q.S; return out;
}template< typename T1, typename T2> pair<T1, T2> operator+(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F+p2.F, p1.S+p2.S};
}template< typename T1, typename T2> pair<T1, T2> operator-(pair<T1, T2> p1, pair<T1, T2> p2){
    return {p1.F-p2.F, p1.S-p2.S};
}


void solve(){
    double r;
    cin >> r;
    double pi = acos(-1);
    cout << 2*pi*r << endl;
}

signed main(){

    ios_base::sync_with_stdio(0); 
    cin.tie(0); cout.tie(0);   

    int t = 1;
    start = clock(); 

    cout << fixed << setprecision(12);

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin); 
    // freopen("output.txt", "w", stdout);
    // freopen("error.txt", "w", stderr);
    // #endif

    //cin >> t;

    for(int i = 1; i <= t; ++i){
        solve();
        //cout << endl;
    }
    //cerr << time(start);
    return 0;
}

Measured memory_bytes: 3820
#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define fr(i,k,n) for (int i = k; i < n; ++i)
#define fri(i,k,n) for (int i = k; i >= n; --i)
#define INF (int)1e9
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define all(arr) arr.begin(),arr.end()

void boost(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

const int N=3005;
int dp[N][N],path[N][N];

void solve(){
	string s,t;
	cin>>s>>t;
	int n=s.size(),m=t.size();
	fr(i,1,n+1){
		fr(j,1,m+1){
			if(s[i-1]==t[j-1]){
				dp[i][j]=dp[i-1][j-1]+1;
				path[i][j]=2;
			}
			else if(dp[i-1][j]>=dp[i][j-1]){
				dp[i][j]=dp[i-1][j];
				path[i][j]=1;
			}
			else{
				dp[i][j]=dp[i][j-1];
				path[i][j]=3;
			}
		}
	}
	string ans;
	int i=n,j=m;
	while(i!=0 && j!=0){
		if(path[i][j]==2){
			ans+=s[i-1];
			i--;j--;
		}
		else if(path[i][j]==1)
			i--;
		else
			j--;
	}
	reverse(all(ans));
	cout<<ans<<endl;
	return;
}

int main()
{
	boost();
	
	int tc=1;
	//cin>>tc;
	while(tc--)
		solve();
	return 0;
}

Measured memory_bytes: 74032
#include<bits/stdc++.h>
using namespace std;

using LL = long long;

const LL MOD = 998244353;

LL BMPow(int x,int n,int m=0){
	LL ans=1;LL p=x;
	if(m==0){ while(n>0){if(n&1==1){ans*=p;} p*=p; n>>=1;}}
	else{ while(n>0){if(n&1==1){ans=(ans*p)%m;} p=(p*p)%m ;n>>=1;}}
	return ans;
}
 
int main(){
	LL n;
	cin>>n;

	vector<LL> d(n);
	LL max_d = 0LL;
	for(int i=0; i<n; i++){
		cin>>d[i];
		max_d = max(max_d,d[i]);
	}

	vector<LL> node_dist_cnt(n,0LL);

	for(int i=0; i<n; i++){
		node_dist_cnt[d[i]]++;
	}

	for(int i=0; i<n; i++){
		if(node_dist_cnt[i]==0){
			if(i<max_d){
				cout<<0<<endl;
				return 0;
			}
		}
	}

	if(node_dist_cnt[0]!=1){
		cout<<0<<endl;
		return 0;
	}

	if(d[0]!=0){
		cout<<0<<endl;
		return 0;
	}

	LL ans=1;
	for(int i=1; i<n; i++){
		if(node_dist_cnt[i]==0) break;
		ans=(ans*BMPow(node_dist_cnt[i-1],node_dist_cnt[i],MOD))%MOD;
	}
	cout<<ans%MOD<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
using namespace std;

int draw(int H, int W, char* str, int count = 0);

int main() {

  int H, W;
  while(1){
    cin >> H >> W;
    
    if(H + W == 0) {
      break;
    }
    char str[W];
    str[0] = '.';
    for(int i = 1; i < W; i++){
      if(str[i - 1] == '.') str[i] = '#';
      else str[i] = '.';
    }

    draw(H, W, str);
    cout << endl;
  }

  return 0;  
}      

int draw(int H, int W, char* str, int count) {
  int size = H * W;

  count++;
  if(count > H) {
    return 0;
  }
  
  for(int i = 0; i < W; i++){
    if(str[i] == '.') str[i] = '#';
    else str[i] = '.';
  }
  str[W] = '\0';
  cout << str << endl;
  draw(H, W, str, count);  
  return 0;
}  

Measured memory_bytes: 1168
//url:
//problem name: 

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int a,b; cin >> a >> b;
    cout << (b%a != 0 ? b-a : a+b) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;

void solve() {
    int64_t a, b, c, d;
    cin >> a >> b >> c >> d;
    int64_t ans = max(a * c, b * d);
    ans = max(ans, max(b * c, a * d));
    cout << ans << '\n';
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
}


Measured memory_bytes: 3648
#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<deque>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;

int main() {
	int n;
	cin >> n;
	while (n--) {
		char a[8];
		for (int i = 0; i < 8; i++)cin >> a[i];
		sort(a, a + 8);
		int m = atoi(a);
		reverse(a, a + 8);
		int M = atoi(a);
		cout << M - m << endl;
	}
	return 0;
}

Measured memory_bytes: 1184
#include <bits/stdc++.h>
using namespace std;

int G;
const int MOD = 1000000007;

int max_count ( vector<vector<int>> score ){
  int count = 0;
  for (int i=0; i<score.at(0).size(); i++)
    count += score.at(0).at(i);
  return count;
}

int halfend(int s_sum, vector<vector<int>> score){
  int target = -1;
  for(int i=score.at(0).size()-1; i>=0; i--){
    if ( score.at(3).at(i) != 1 ){
      target = i;
      break;
    }
  }
    
  if(target==-1) //解ける問題が存在しない
    return MOD;
  
  int solve = (G-s_sum+100*(target+1)+1) / (100*(target+1)+1);

  if(solve>score.at(0).at(target)-1)
    return MOD; //問題数が足りない
  else
    return solve;

}


int q_count (int s_sum, int q_sum, vector<vector<int>> score, int q_now){
 
  if ( s_sum == G ){ //ぴったりの場合
    return q_sum;
  }
  
  if ( s_sum > G ){ //目標値を越えた
    s_sum -= score.at(2).at(q_now-1);
    int i = q_sum - score.at(0).at(q_now-1);
    return min( halfend(s_sum, score)+i , q_sum);
  }
  
  if ( q_now == score.at(0).size() ){ //最後まで行ったけど足りない
    return min(max_count( score ), halfend(s_sum, score)+q_sum );
  }

  int no_ans = q_count(s_sum, q_sum, score, q_now+1);

  score.at(3).at(q_now) = 1;
  int ans = q_count(s_sum+score.at(2).at(q_now), q_sum + score.at(0).at(q_now), score, q_now+1);
  
  return min ( ans, no_ans );
  
}



int main(){
  int D;
  cin >> D >> G;
  
  vector<vector<int>> score(4,vector<int>(D));


  for (int i=0; i<D; i++){
    cin >> score.at(0).at(i) >> score.at(1).at(i);
    score.at(2).at(i) = 100*score.at(0).at(i)*(i+1) + score.at(1).at(i);
    if(score.at(0).at(i) == 1)
      score.at(3).at(i) = 1;
  }
  
  cout << q_count (0, 0, score, 0) << endl;


}

Measured memory_bytes: 256
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,u,v = mi()
data = [[] for _ in range(n)]
for i in range(n-1):
    a,b = mi()
    a -= 1
    b -= 1
    data[a].append(b)
    data[b].append(a)
inf = -1
oni = [inf]*n
ko = [inf]*n

from collections import deque

def start(hazime,alis):
    d = deque()
    d.append((hazime-1,0))
    alis[hazime-1] = 0
    while d:
        ima,num = d.popleft()
        num += 1
        for i in data[ima]:
            if alis[i] != inf:
                continue
            alis[i] = num 
            d.append((i,num))
start(u,ko)
start(v,oni)

if len(data[u]) == 1 and data[u] == v:
    print(0) 
    exit()
ans = -1
for i in range(n):
    if ko[i] <= oni[i]:
        ans = max(ans,oni[i]-1)
print(ans)



Measured memory_bytes: 28832
#include <iostream>

using namespace std;

int main(){
    int n;
    int max=-1;
    int sum=0;
    cin >> n;
    for(int i=0; i<n; ++i){
        int p;
        cin >> p;
        if(p>max) max=p;
        sum+=p;
    }
    cout << sum-max/2 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
#include<tuple>
using namespace std;


typedef long long ll;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)

const int mod = 1000000007;

int main(){
    int a, b;
    cin >> a >> b;
    int ans = min(a, b);
    rep(i, max(a, b)){
        cout << ans;
    }
    cout << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#pragma G++ optimize(2)
#include<bits/stdc++.h>
#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define ss(a) scanf("%s",a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i,a,b) for(register int i=a;i<=b;++i)
#define repd(i,a,b) for(register int i=a;i>=b;--i)
#define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
#define ce(i,r) i==r?'\n':' '
#define pb push_back 
#define all(x) x.begin(),x.end()
#define fi first
#define se second
//#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef long long ll;
const int MAX_N=1e5+5;
const ll inf=1e18;
inline int qi(){
    int f=0,fu=1; char c=getchar();
    while(c<'0'||c>'9'){ if(c=='-')fu=-1; c=getchar(); }
    while(c>='0'&&c<='9'){ f=(f<<3)+(f<<1)+c-48; c=getchar(); }
    return f*fu;
}
inline ll ql(){
	ll f=0;int fu=1; char c=getchar();
    while(c<'0'||c>'9'){ if(c=='-')fu=-1; c=getchar(); }
    while(c>='0'&&c<='9'){ f=(f<<3)+(f<<1)+c-48; c=getchar(); }
    return f*fu;
}
ll c[MAX_N],p[MAX_N];
bool vis[MAX_N];
ll b[MAX_N],sum[MAX_N];
int q[MAX_N],st,ed;
ll cal(vector<ll> a,ll k)
{
 
	b[0]=sum[0]=0;
	for(auto x:a) b[++b[0]]=c[x];
	
	repi(i,1,b[0]) b[b[0]+i]=b[2*b[0]+i]=b[i];
	repi(i,1,3*b[0]) sum[i]=sum[i-1]+b[i];
	ll res=0,tk=k,tmp=-inf;
	if(sum[b[0]]>0&&(tk/b[0])>2) res+=sum[b[0]]*((tk/b[0])-1),tk-=b[0]*((tk/b[0])-1);
	else if(sum[b[0]]<0) tk=min(tk,b[0]-1);
	repi(i,1,tk)repi(j,1,b[0]) tmp=max(tmp,sum[j+i-1]-sum[j-1]);
	return res+tmp;
}
int main()
{
	ll n=ql(),k=ql();
	repi(i,1,n) p[i]=ql();
	repi(i,1,n) c[i]=ql();
	ll ans=-inf;
	repi(i,1,n)if(!vis[i]){
		ll now=i;
        vector<ll> tmp;
        while(p[now]!=i) tmp.pb(now),vis[now]=true,now=p[now]; vis[now]=true,tmp.pb(now);
    	ans=max(ans,cal(tmp,k));
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 4144
num = gets.to_i
n = gets.split.map(&:to_i)
check = 0
ans = 0
num.times{|i| check += 1 if n[i] < 0}
if check % 2 == 0
  num.times{|i| ans += n[i].abs}
else
  num.times{|i|
    ans += n[i].abs
    n[i] = n[i].abs
  }
  n.sort!
  ans -= n[0]*2
end
puts ans


Measured memory_bytes: 9344
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long 
#define REP(i, a, b) for (ll i = a; i < b; i++)
#define REPI(i, a, b) for (ll i = b - 1; i >= a; i--)
#define i_os ios::sync_with_stdio(0);  cin.tie(0);  cout.tie(0);
#define INF (ll)1e18 + 100
#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define MAX 1e6
/*SOME BITMASK KNOWLEDGE
1)x & (x - 1):sets the last one bit of x to zero
power of two exactly when x & (x − 1) = 0.
2)x & -x:sets all the one bits to zero, except last one bit
3)x | (x - 1):inverts all the bits after the last one bit*/
#define o_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define o_setll tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
typedef tree<pair<ll, ll>,null_type,less<pair<ll, ll>>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

int main() 
{
	ll n;
	cin>>n;
	set<string> s;
	REP(i,0,n){
		string y;
		cin>>y;
		s.insert(y);
	}
	cout<<s.size()<<endl;
	return 0;
}  


Measured memory_bytes: 19212
#include<stdio.h>
#include<string.h>

int main(void) {
	long int N, i;
	char judge[4];
	char* s1 = "AC", * s2 = "WA", * s3 = "TLE", * s4 = "RE";
	int a = 0, w = 0, t = 0, r = 0;

	scanf("%d", &N);

	for (i = 0; i < N; i++) {
		scanf("%s", judge);

		if (strcmp(judge, s1) == 0) {
			a += 1;
		}
		else if (strcmp(judge, s2) == 0) {
			w += 1;
		}
		else if (strcmp(judge, s3) == 0) {
			t += 1;
		}
		else if (strcmp(judge, s4) == 0) {
			r += 1;
		}
	}
	printf("AC x %d\n", a);
	printf("WA x %d\n", w);
	printf("TLE x %d\n", t);
	printf("RE x %d\n", r);

	return 0;
}

Measured memory_bytes: 1728
N,A,B,C = map(int,input().split())
MOD = 10**9+7

MAXN = 200005
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def comb(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

a = A * inv[A+B]
b = B * inv[A+B]
apow = [1]
bpow = [1]
for _ in range(N+1):
    apow.append((apow[-1] * a) % MOD)
    bpow.append((bpow[-1] * b) % MOD)

ans = 0
for m in range(N,2*N):
    pa = apow[N] * bpow[m-N]
    pb = bpow[N] * apow[m-N]
    tmp = m * comb(m-1, N-1) * (pa + pb)
    ans += tmp
    ans %= MOD
ans *= 100 * inv[100-C]
ans %= MOD

print(ans)

Measured memory_bytes: 36184
#include <bits/stdc++.h>

using namespace std;

#define INF 1000007
#define MOD 1000000007
#define maxn 10001
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define int long long
const double PI = acos(-1);
typedef pair<int, int> P;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

int lcm(int a, int b) { return a / gcd(a, b) * b; }

int mpow(int N, int P, int M) //繰り返し自乗法
{
    if (P == 0)
        return 1;
    if (P % 2 == 0)
    {
        int t = mpow(N, P / 2, M);
        return t * t % M;
    }
    return N * mpow(N, P - 1, M) % M;
}

int counter(int x) //bit計算
{
    if (x == 0)
        return 0;
    return counter(x >> 1) + (x & 1);
}

vector<bool> prime(maxn + 1, true); //素数テーブル
void prime_table(void)
{
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= maxn; i++)
    {
        if (!prime[i])
        {
            continue;
        }
        for (int j = i + i; j <= maxn; j += j + i)
        {
            prime[j] = false;
        }
    }
}

bool IsPrime(int num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}
vector<int> divisor(int n) //約数列挙
{
    vector<int> ret;
    for (int i = 1; i * i <= n; i++)
    {
        if (n % i == 0)
        {
            ret.push_back(i - 1);
            if (i * i != n)
            {
                ret.push_back((n / i) - 1);
            }
        }
    }
    sort(ret.begin(), ret.end());
    return (ret);
}

signed main()
{
    int N;
    cin >> N;
    int count = 0;
    for (int i = 1; i <= N; i++)
    {
        if (i % 2 == 1)
        {
            count++;
        }
    }
    cout << fixed << setprecision(10) << ((double)count / N) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

#define name ""
#define ini freopen(name".inp","r",stdin); freopen(name".out","w",stdout)
#define foe(it,c) for (__typeof(c.begin()) it = c.begin(); it != c.end(); it++)
#define long long long 
#define db double 
#define pii pair <int, int>
#define pll pair <long, long>
#define all(c) c.begin(), c.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

const int INF = 1e9+7;
const int MOD = 1e9+7;
const int dx[4] = {0,0,-1,1};
const int dy[4] = {-1,1,0,0};

int cnt[2019];
long res = 0;

int main()
{
  fastio;
  string s; cin >> s; 
  reverse(all(s)); cnt[0] = 1;
  int x = 0; int cur = 1;
  for (int i = 0; i < s.size(); i++){
    x += cur * (s[i] - '0');
    x %= 2019; res += cnt[x]; cnt[x]++;
    cur *= 10; cur %= 2019;    
  }
  cout << res;
  return 0;
}

Measured memory_bytes: 3780
#include <bits/stdc++.h>
using namespace std;

int main(){
	vector<int> A(10,0);
	for(int i=0;i<3;i++){
		int x;
		cin >> x;
		A[x]++;
	}
	sort(A.begin(),A.end(),greater<int>());
	if(A[0]==2)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
//
//  main.cpp
//  Study
//
//  Created by 佐々木勇星 on 2020/03/12.
//  Copyright © 2020 佐々木勇星. All rights reserved.
//

#include <iostream>
#include <vector>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <map>

using namespace std;


int main(int argc, const char * argv[]) {

    double r;
    
    cin >> r;
    
    printf("%.10f\n", 2*M_PI*r);
    
    return 0;
    
}


Measured memory_bytes: 3812
s = gets.chomp
t = gets

ks = {}
kt = {}

ok = true
s.size.times do |i|
  unless ks.include?(s[i])
    ks[s[i]] = ks.size
  end

  unless kt.include?(t[i])
    kt[t[i]] = kt.size
  end

  unless ks[s[i]] == kt[t[i]]
    ok = false
    break
  end
end

puts(ok ? 'Yes' : 'No')


Measured memory_bytes: 2556
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(2, vector<int>(n));
  rep(i, 2) rep(j, n) cin >> a[i][j];

  int maxValue = INT_MIN;
  int currentIndex = 0;
  rep(i, n) {
    int value = 0;
    currentIndex = 0;
    rep(j, n) {
      if (i == j) {
        // ここで移動
        value += a[currentIndex][j];
        currentIndex = 1;
      }
      value += a[currentIndex][j];
    }
    maxValue = max(value, maxValue);
  }
  cout << maxValue << endl;

  return 0;
}


Measured memory_bytes: 764
from itertools import product

N, M = map(int, input().split())
k = [0] * M
s = [[0] for _ in range(M)]
for i in range(M):
    k[i], *s[i] = map(int, input().split())
p = list(map(int, input().split()))
a = list(product([0, 1], repeat=N))  # N=3なら000~111までの8個の直積のリスト
# print(a)

ans = 0
for c in a:  # スイッチ状態を全てについて調べる
    cnt = 0
    for i in range(M):  # 電球はM個ある
        tmp = 0
        for t in s[i]:  # s[i]には電球iのスイッチ条件
            tmp += c[t - 1]  # s[i]に書かれていたスイッチのOn／offをtmpに足していく．
            # print("tmp : {}".format(tmp))
        if tmp % 2 == p[i]:
            cnt += 1
    if cnt == M:  # 全ての電球が点灯するなら，組み合わせ数に一つ加える
        ans += 1
print(ans)

Measured memory_bytes: 3188
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        string s = Console.ReadLine();
        var best = 0;
        var lis = new List<char>();
        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] != 'A'
                && s[i] != 'C'
                && s[i] != 'G'
                && s[i] != 'T')
            {
                if (lis.Count > best)
                {
                    best = lis.Count;
                }
                lis.Clear();
                continue;
            }
            lis.Add(s[i]);
        }
        if (lis.Count > best)
        {
            best = lis.Count;
        }
        Console.WriteLine(best);
    }
}


Measured memory_bytes: 13268
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);

		while (true) {
			int n = scan.nextInt();
			int m = scan.nextInt();
			int t = scan.nextInt();
			int p = scan.nextInt();

			if (n == 0 && m == 0) {
				break;
			}

			ArrayList<ArrayList<Integer>> paper = new ArrayList<ArrayList<Integer>>();
			int hole = 0;

			for (int i = 0; i < m; i++) {
				ArrayList<Integer> array = new ArrayList<Integer>();
				for (int j = 0; j < n; j++) {
					array.add(1);
				}
				paper.add(array);
			}

			//for (int pap = paper.size() - 1; pap >= 0; pap--) {
			//	System.out.println(paper.get(pap));
			//}
			//System.out.println("");

			for (int i = 0; i < t; i++) {
				int d = scan.nextInt();
				int c = scan.nextInt();
				switch (d) {
				case 1:
					for (int j = 0; j < paper.size(); j++) {
						for (int k = 0; k < c; k++) {
							if (c >= paper.get(j).size()) {
								paper.get(j).add(paper.get(j).get(c - k - 1));
							} else {
								paper.get(j).set(c, paper.get(j).get(c) + paper.get(j).get(c - k - 1));
							}
							paper.get(j).remove(c - k - 1);
						}
					}
					break;
				case 2:
					for (int j = 0; j < c; j++) {
						if (c >= paper.size()) {
							paper.add(paper.get(c - j - 1));
						} else {
							for (int k = 0; k < paper.get(j).size(); k++) {
								paper.get(c).set(k, paper.get(c).get(k) + paper.get(c - j - 1).get(k));
							}
						}
						paper.remove(c - j - 1);
					}
					break;
				}
				//for (int pap = paper.size() - 1; pap >= 0; pap--) {
				//	System.out.println(paper.get(pap));
				//}
				//System.out.println("");
			}

			for (int i = 0; i < p; i++) {
				int x = scan.nextInt();
				int y = scan.nextInt();
				hole = paper.get(y).get(x);
				System.out.println(hole);
			}
			//System.out.println("next");
		}
		scan.close();
	}
}



Measured memory_bytes: 43384
n = gets.to_i
max = 1
maxCnt = 0

(1..n).each do |val|
    tmpCnt = 0
    if val.odd?
        next
    else
        calcVal = val
        while calcVal.even?
            calcVal /= 2
            tmpCnt += 1
        end
    end
    
    if tmpCnt > maxCnt
        maxCnt = tmpCnt
        max = val
    end
end

puts max

Measured memory_bytes: 14288
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <string.h>
#include <cstdlib>
#include <ctime>
#include <cmath>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <numeric>
#include <cctype>
#include <bitset>
#include <cassert>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define gep(i,g,j) for(int i = g.head[j]; i != -1; i = g.e[i].next)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
using namespace std;
typedef long long int ll;
typedef pair<int,ll> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;



int main() {
  int n,q;
  scanf("%d%d",&n,&q);
  map<int,ll> s;
  s.insert(P(0,LINF));
  s.insert(P(n,LINF));
  auto add = [&](map<int,ll>::iterator it, int r, ll x) {
    // cout<<it->fi<<" "<<r<<" "<<x<<endl;
    it->se -= x;
    if (!it->se) s.erase(it++); else ++it;
    if (it->fi == r) {
      it->se += x;
    } else s.insert(P(r,x));
  };
  rep(qi,q) {
    int m;
    ll a;
    scanf("%d%lld",&m,&a);
    while (a) {
      auto it = s.lower_bound(m);
      --it;
      int w = m-it->fi;
      ll c = min(a/w, it->se);
      if (c) {
        add(it,m,c);
        a -= c*w;
      } else {
        add(it,it->fi+a,1);
        break;
      }
    }
    // for (auto p : s) cout<<p<<endl;
    // cout<<""<<endl;
  }
  vl ans(n+1);
  for (auto p : s) ans[p.fi] = -p.se;
  ans[0] += LINF;
  rep(i,n) ans[i+1] += ans[i];
  rep(i,n) printf("%lld\n",ans[i]);
  return 0;
}































Measured memory_bytes: 8448