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

int main()
{
    int A, B;
    cin >> A >> B;
    int ADD = A + B;
    int PULL = A - B;
    int CALL = A *B;
    if (ADD > PULL)
    {
        if (ADD > CALL)
        {
            cout << ADD << endl;
        }
        else
        {
            cout << CALL << endl;
        }
    }
    else
    {
        if (CALL > PULL)
        {
            cout << CALL << endl;
        }
        else
        {
            cout << PULL << endl;
        }
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fr(i,j,n)   for(int i=j;i<n;i++)
#define pb          push_back
#define rf(i,j,p)   for(int i=p;i>=j;i--)
#define vi          vector<int>
#define vll         vector<long long>
#define ll          long long
#define hmm         "\n"
#define sp          " "
#define srt(v)      sort(v.begin(), v.end());
#define down        cout<<hmm;
#define faaast      ios_base::sync_with_stdio(0);cin.tie(nullptr);
using namespace std;
int main()
{
 int n ; cin >>  n ;
 int a[n]; int o=0, e=0;
 fr(i,0,n)
 {
     cin >> a[i];
     if(a[i]%2==0)e++;
     else o++;
 }
 if(o%2==0)cout<<"YES"<<hmm;
 else cout<<"NO"<<hmm;
}


Measured memory_bytes: 3944
/*
    author: masab hasnain
*/

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

const double PI  =3.141592653589793238463;

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

    long double r;
    cin >> r;
    r = 2.0 * PI * r;
    cout << r << endl;
}


Measured memory_bytes: 3804
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a, b, c, d;
  in(n);
  a = 0;
  b = 0;
  c = 0;
  d = 0;
  string s;
  rep(i, n){
    in(s);
    if(s == "AC")
      a++;
    if(s == "WA")
      b++;
    if(s == "TLE")
      c++;
    if(s == "RE")
      d++;
  }
  out("AC x ");
  out(a);
  memi;
  out("WA x ");
  out(b);
  memi;
  out("TLE x ");
  out(c);
  memi;
  out("RE x ");
  out(d);
  memi;
}

Measured memory_bytes: 3624
using System;

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine().Split(' ');
        var num1 = Convert.ToInt32(input[0]);
        var num2 = Convert.ToInt32(input[1]);

        var max = Math.Max(num1 + num2, num1 - num2);
        Console.WriteLine(Math.Max(max, num1 * num2));
    }
}

Measured memory_bytes: 11220
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;} 
int main(void)
{
  int a,b,ans;
  scanf("%d %d",&a,&b);
  for(int i=0;i<1009;i++)
  {
    if(floor(i*0.08)==a&&floor(i*0.1)==b)
    {
      ans=i;
      break;
    }
    else
      ans=-1;
      
  }
  
  printf("%d",ans);
    
}

Measured memory_bytes: 128
t1 = int(input())
t2 = int(input())
if not t1 < t2:
    t1, t2 = t2, t1
if t2 - t1 <= 180:
    print((t2 + t1)/2)
else:
    print(((t2 + t1 + 360) % 720)/2)



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

int count_devide2(int num) {

    int count = 0;

    // cout << num << endl;

    while(num % 2 == 0) {
        count ++;
        num /= 2;
    }

    return count;
}

int main()
{
    int N;
    cin >> N;

    vector<int> A(N);

    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
    }

    int ans = 0;

    for(int i = 0; i < N; i++) {
        ans += count_devide2(A.at(i));
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<tuple>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define Per(i,sta,n) for(int i=n-1;i>=sta;i--)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

int n,k;
int a[100010];
ll b[100010];

void solve(){
    cin >> n >> k;
    rep(i,n){
        cin >> a[i] >> b[i];
    }
    ll ans=0;
    rep(i,32){
        ll res=0;
        vector<int> v;
        if(i>0){
            if(!(k & (1 << (i-1)))) continue;
            v.push_back(i-1);
        } 
        Rep(j,i,32){
            if(!(k & (1 << j))){
                v.push_back(j);
            }
        }
        rep(s,n){
            bool flag=true;
            for(int t:v){
                if(a[s]&(1 << t)){
                    flag=false;
                }
            }
            if(flag)res+=b[s];
        }
        ans=max(ans,res);
    }
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(50);
    solve();
}

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

using namespace std;

typedef long long ll;

int main()
{
    ll N;
    ll t[100000];
    ll x[100000];
    ll y[100000];
    cin >> N;
    bool flag = true;
    for (int i = 0; i < N; i++) {
        cin >> t[i] >> x[i] >> y[i];
    }
    if (!(t[0] >= x[0] + y[0])) {
        flag = false;
    }
    if (!(t[0] % 2 == (x[0] + y[0]) % 2)) {
        flag = false;
    }
    for (int i = 1; i < N; i++) {
        if (!(t[i] - t[i - 1] >= abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1]))) {
            flag = false;
        }
        if (!((t[i] - t[i - 1]) % 2 == (abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1])) % 2)) {
            flag = false;
        }
    }
    if (flag) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 2560
#include<stdio.h>
#include<string.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
static inline void PUT(char c)
{
  static char buf[1<<15],*ptr=buf;
  if(ptr==buf+strlen(buf)||c==0){fwrite(buf,1,ptr-buf,stdout),ptr=buf;}*ptr++=c;
}
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(long a)
{
  if(a<0)PUT('-'),a=-a;
  int d[40],i=0;do{d[i++]=a%10;}while(a/=10);
  while(i--){PUT(d[i]+48);}PUT('\n');
}
int main()
{
  int i=0,N=IN(),Q=IN(),H=N,W=N,col[N],row[N];long b=1l*(N-2)*(N-2);
  while(i<N){row[i]=col[i]=N;i++;}
  while(Q--)
  {
    int type=IN(),x=IN()-1;
    if(type==1){if(x<W){i=x;while(i<W-1){col[i++]=H;}W=x+1;}b-=col[x]-2;}
    else{if(x<H){i=x;while(i<H-1){row[i++]=W;}H=x+1;}b-=row[x]-2;}
  }
  return OUT(b),0;
}

Measured memory_bytes: 3056
import collections

def solve(N, Ss):
    counter = collections.Counter()
    counter.update(Ss)
    max_count = counter.most_common()[0][1]
    ans = []
    for s, count in counter.most_common():
        if count == max_count:
            ans.append(s)

    return "\n".join(sorted(ans))

if __name__ == "__main__":
    N = int(input())
    Ss = []
    for _ in range(N):
        Ss.append(input())
    print(solve(N, Ss))


Measured memory_bytes: 45040
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val N = sc.nextInt
    val ans =
      if (N % 2 == 0) N / 2
      else (N / 2) + 1
    println(ans)
  }
}


Measured memory_bytes: 27048
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

#define ll long long

#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //(i, 10) i=0～i=9まで
#define repr(i, n) for (int i = n; i >= 0; i--)   // (i, 10) i=10～i=0まで
#define FOR(i, m, n) for (int i = m; i < n; i++)  // (i, 3, 10) i=3～i=9まで

int main() {
    while (true) {
        int x, y;
        cin >> x >> y;
        if (x == 0 && y == 0) break;
        if (x > y) swap(x, y);
        cout << x << " " << y << "\n";
    }
    return 0;
}



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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    for (int i = 0; i < (int)s.length(); ++i) cout << 'x';
    cout << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set> 
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <iomanip>
using namespace std;
#define assem99 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define ld long double
#define ii pair<int, int>
#define pll pair<ll, ll>
#define vii vector<ii>
#define f(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define sz(a) (int)(a).size()
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
int x[] = { 0, -1, 0, 1, -1, 1, -1, 1 };
int y[] = { -1, 0, 1, 0, 1, -1, -1, 1 };
const int MOD = 998244353, N = 1e5 + 5;
const double pi = acos(-1);

int dp[200][N], weight[N], val[N];
// dp [items][sum of values]

int main()
{
	assem99;

	int n, w; cin >> n >> w;
	int sum = 0;
	f(i, 1, n + 1)
	{
		cin >> weight[i] >> val[i];
		sum += val[i];
	}
	f(i, 0, 105) f(j, 0, N) dp[i][j] = 1e9;
	f(i, 0, 105) dp[i][0] = 0;
	int ans = 0;
	f(i, 1, n + 1)
	{
		f(j, 1, sum + 1)
		{
			if (val[i] <= j) dp[i][j] = min(dp[i - 1][j], weight[i] + dp[i - 1][j - val[i]]);
			else dp[i][j] = dp[i - 1][j];
			if (dp[i][j] <= w) ans = max(ans, j);
		}
	}
	
	//f(i, 0, min(sum, w) + 1) ans = max(ans, dp[n][i]);
	cout << ans;

	return 0;
}


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

int main(){
  int H, W;
  cin >> H >> W;
  vector<vector<char>> v(H, vector<char>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cin >> v.at(i).at(j);
    }
  }
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      cout << v.at(i).at(j);
    }
    cout << endl;
    for (int j = 0; j < W; j++) {
      cout << v.at(i).at(j);
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
///mAAria...
#include<bits/stdc++.h>
 
using namespace std;
 
#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(),v.end()
#define ld long double
#define ff first
#define ss second
#define pii pair<int,int>
#define pi 3.1415926535897932384626433832
#define mod 1000000007
#define inf 1000000000
#define pr1(a) cout << a << endl
#define pr2(a,b)cout << a <<  " " <<b<< endl
#define pr3(a,b,c) cout << a <<" " << b << " " << c << endl

const long double PI = acos(-1);

int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

int gcd(int a, int b){
    if(b==0)return a;
    gcd(b,a%b);
}


void solve(){
    int a,b;
    cin >> a >> b;

    for(int i = 1;i<=2000;i++){

        if((int)((double)i*0.08)==a && (int)((double)i*0.1)==b){
            cout << i << endl;
            return;
        }
    }
    cout << -1 << endl;


 
} 

signed main() 
{   
    IOS;
    int t = 1;
    //cin >> t;

    for(int i = 1;i<=t;i++){
        solve();
    }
    return 0;
} 

 


Measured memory_bytes: 256
#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 K;
  cin >> K;
  vector<ll> a;
  for(int i = 1; i <= 9; i++) a.push_back(i);
  while (1) {
    if ( K <= a.size()) {
      cout << a[K-1] << endl;
      return 0;
    }
    K -= a.size();
    vector<ll> old;
    swap(old, a);
    for (ll x: old) {
      for (int i = -1; i <= 1; i++) {
        int d = x%10 + i;
        if (d< 0 || d > 9) continue;
        ll nx = x*10 + d;
        a.push_back(nx);
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1712
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
#define fi first
#define se second 
#define pb push_back
ll f(ll x){
	if(x==1)return 1;
	return 2*f(x/2)+1;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll x; 
	cin>>x; 
	cout<<f(x)<<endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, k;
	cin >> n >> k;

	vector<int> x(n);
	for (auto &v : x) {
		cin >> v;
	}

	int ans = INT_MAX;
	for (int l = 0; l <= n - k; l++) {
		int r = l + k - 1;
		ans = min(ans, x[r] - x[l] + min(abs(x[l]), abs(x[r])));
	}
	cout << ans << endl;
	return 0;
}


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

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

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N, D; cin >> N >> D;
    int ans = 0;
    rep(i, N){
        ll X, Y; cin >> X >> Y;
        if(D*D >= X*X + Y*Y) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>

int main(void)
{
        int n,a[100],min,max,i;

        scanf("%d",&n);

        for (i=0;i<n;i++){
                scanf("%d",&a[i]);
        }

        min=a[0];
        max=a[0];

        for (i=1;i<n;i++){
                if(min>a[i])
                        min=a[i];
                if (max<a[i])
                        max=a[i];
        }

        printf("%d\n",max-min);

        return 0;
}

Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {

        int n = int.Parse(Console.ReadLine());
        var line = new List<string>();

        for(var i=0; i < n; i++)
        {
            string present = Console.ReadLine();
            line.Add(present);
          
        }

        int cnt = line.Distinct().Count();
        Console.WriteLine(cnt);

    }
}

Measured memory_bytes: 48212
'''
研究室PCでの解答
'''
import math
#import numpy as np
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
#setrecursionlimit(10**7)
mod = 10**9+7
dir = [(-1,0),(1,0),(0,-1),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"


def main():
    n,k = map(int,ipt().split())
    a = [int(i) for i in ipt().split()]

    memo = deque()
    memo.append(0)
    d = defaultdict(int)
    ans = 0
    nv = 0
    d[0] += 1
    for i,ai in enumerate(a):
        nv += ai-1
        nv %= k
        memo.append(nv)
        if i >= k-1:
            pi = memo.popleft()
            d[pi] -= 1
        ans += d[nv]
        d[nv] += 1

    print(ans)

    return None

if __name__ == '__main__':
    main()


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

using namespace std;
typedef long long ll;

int main()
{
    ll n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    ll diff = b - a;
    ll max_r = d * (n-1);
    ll min_r = c * (n-1);
    for(ll i=0; i<n; i++)
    {
        if(min_r<=diff && diff<=max_r)
        {
            cout << "YES" << endl;
            return 0;
        }
        max_r -= (c + d);
        min_r -= (c + d);
    }
    cout << "NO" << endl;
}


Measured memory_bytes: 256
' Imports System.Collections.Generic
' Imports System.Text.RegularExpressions

Class Main
    Public Shared Sub Main()
        Dim N, M As Integer
        Dim arr() As String
        arr = Split(Console.ReadLine())
        N = arr(0) : M = arr(1)
        Console.WriteLine( _
            Math.Ceiling(N * (N - 1) / 2) + Math.Ceiling(M * (M - 1) / 2))
    End Sub
End Class


Measured memory_bytes: 11488
import java.util.*;
import java.lang.Object;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int[][] dot = new int[n][d];
        int dis = 0;
        int sum = 0;
        int cnt = 0;

        for(int i = 0;i<n;i++){
            for(int j = 0;j<d;j++){
                dot[i][j] = sc.nextInt();
            }
        }

        for(int i = 0;i<n-1;i++){
            for(int j = i+1;j<n;j++){
                for(int k = 0;k<d;k++){
                    sum+=(dot[i][k]-dot[j][k])*(dot[i][k]-dot[j][k]);
                }
                int ans = (int)Math.sqrt(sum);
                if(ans == Math.sqrt(sum)){
                    cnt++;
                }
                sum = 0;
            }
        }

            System.out.println(cnt);

    }
}


Measured memory_bytes: 21716
#include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
vector<vector<ll>> DP;

int main(void) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<ll> A(N);
  ll total = 0;
  rep(i, N) {
    cin >> A[i];
    total += A[i];
  }

  int lp = 1;
  ll llen = A[0];
  ll rlen = total - A[0];
  ll mind = abs(rlen - llen);
  while (lp < N) {
    llen += A[lp];
    rlen -= A[lp];
    ll newd = abs(rlen - llen);
    if (newd < mind) {
      mind = newd;
    }
    lp++;
  }
  cout << mind << endl;
  return 0;
}


Measured memory_bytes: 1792
import java.util.Arrays;
import java.util.Scanner;

//Pasta
public class Main{

	int n, k, MOD = 10000;
	int[] a;
	int[][][] dp;
	
	int get(int v, int s, int c){
		if(a[v]!=-1&&a[v]!=s)return 0;
		if(v==n){
			if(c!=1)return 0;
			if(a[n]==-1||s==a[n])return 1;
			else return 0;
		}
		if(dp[v][s][c]!=-1)return dp[v][s][c];
		int res = 0;
		if(c==1){
			if(a[v+1]==s)res = 0;
			else{
				for(int j=0;j<3;j++){
					if(s==j)continue;
					res = (res+get(v+1, j, 1)+get(v+1, j, 2))%MOD;
				}
			}
		}
		else{
			if(a[v+1]!=-1&&a[v+1]!=s)res = 0;
			else{
				if(v+2<=n&&a[v+2]==s)res = 0;
				else{
					res = get(v+1, s, 1);
				}
			}
		}
		return dp[v][s][c] = res;
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		n = sc.nextInt(); k = sc.nextInt();
		a = new int[n+1];
		Arrays.fill(a, -1);
		while(k--!=0)a[sc.nextInt()]=sc.nextInt()-1;
		dp = new int[n+1][3][3];
		for(int[][]b:dp)for(int[]c:b)Arrays.fill(c, -1);
		int res = 0;
		for(int j=0;j<3;j++)for(int c=1;c<3;c++)res+=get(1, j, c);
		System.out.println(res%MOD);
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  i64 N;
  cin >> N;

  i64 r = 0;
  if (!(N & 1)) {
    i64 q = 10;
    r += N / q;
    q *= 5;
    F0R(i, 24) {
      r += N / q;
      q *= 5;
    }
  }
  cout << r;
}
#endif


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,a[100000],count=0;
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++){
		if(a[a[i]]==i)count++;
	}
	cout<<count/2<<endl;
}


Measured memory_bytes: 768
//F 
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n,ans = 2;
	cin >> n;
	for(ll i = 2;i*i <= n-1;i++){
		if((n-1)%i == 0){
			ans += 2;
			if((n-1)/i == i)ans--;
		}
	}
	for(ll k = 2;k*k <= n;k++){
		if(n%k)continue;
		ll u = n;
		while(u%k == 0)u /= k;
		u %= k;
		if(u%k == 1 or u == 1)ans++; 
	}
	if(n == 2)ans--; 
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 10;
const int INF = 0x3f3f3f3f;
const ll inf = 0x3f3f3f3f3f3f3f3f;
int k, a, b;
int main(){
	cin >> k >> a >> b;
	for (int i = a; i <= b; i++) {
		if (i%k == 0) { puts("OK"); return 0; }
	}
	puts("NG");
	return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define len(val) static_cast<long long>(val.size())
#define rep(i, n) for(int i=0; i<(n); i++)
typedef long long ll;
typedef pair<int, int> P;


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

    string s;
    cin >> s;
    cout << s.substr(0, 4) << " " << s.substr(4, 8) << endl;
}


Measured memory_bytes: 384
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var f = new int[n];
        for (int i = 0; i < n; i++)
        {
            var s = Console.ReadLine().Split();
            for (int j = 0; j < 10; j++)
            {
                if (s[j] == "1") f[i] |= 1 << j;
            }
        }
        var p = new int[n][];
        for (int i = 0; i < n; i++)
        {
            p[i] = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        }

        var ans = int.MinValue;
        for (int x = 1; x < 1024; x++)
        {
            var sum = 0;
            for (int i = 0; i < n; i++)
            {
                var j = count(x & f[i]);
                sum += p[i][j];
            }
            ans = Math.Max(ans, sum);
        }
        Console.WriteLine(ans);
    }

    static int count(int x)
    {
        var ans = 0;
        for (int i = 0; i < 10; i++)
        {
            if ((x >> i & 1) == 1) ans++;
        }
        return ans;
    }
}


Measured memory_bytes: 13268
def inpl(): return list(map(int, input().split()))
from collections import defaultdict
from itertools import combinations, permutations

N = int(input())
S = list(map(int, input()))

move = defaultdict(int)
b = S[0]
for i in range(N-1):
    a, b = S[i], S[i+1]
    move[(a, b)] += 1
    move[(b, a)] += 1

R = set(list(range(1, 10)))
bestscore = 10**10
bestans = "9"*9

def calc_br(bl, re):
    b0, b1, b2, b3 = bl
    r0, r1, r2, r3 = re
    stage3 = 0
    stage3 += move[(b0, r3)] + move[(b0, r0)] + 3*move[(b0, r1)] + 3*move[(b0, r2)]
    stage3 += move[(b1, r0)] + move[(b1, r1)] + 3*move[(b1, r2)] + 3*move[(b1, r3)]
    stage3 += move[(b2, r1)] + move[(b2, r2)] + 3*move[(b2, r3)] + 3*move[(b2, r0)]
    stage3 += move[(b3, r2)] + move[(b3, r3)] + 3*move[(b3, r0)] + 3*move[(b3, r1)]
    return stage3
    
    
def fliplr(black, bl, re):
    order = [bl[0], re[0], bl[1],
             re[3], black, re[1],
             bl[3], re[2], bl[2]]
    best = [9] * 9
    ixss = [[0, 1, 2, 3, 4, 5, 6, 7, 8],
            [2, 5, 8, 1, 4, 7, 0, 3, 6],
            [8, 7, 6, 5, 4, 3, 2, 1, 0],
            [6, 3, 0, 7, 4, 1, 8, 5, 2],
            [2, 1, 0, 5, 4, 3, 8, 7, 6],
            [0, 3, 6, 1, 4, 7, 2, 5, 8],
            [6, 7, 8, 3, 4, 5, 0, 1, 2],
            [8, 5, 2, 7, 4, 1, 6, 3, 0]]
    best = min(["".join([str(order[ix]) for ix in ixs]) for ixs in ixss])
    return best
    
    
for black in range(1, 10):
    remain = R.difference([black])
    for blue in combinations(remain, r=4):
        red = list(remain - set(blue))
        stage1 = 0
        for r in red:
            stage1 += move[(black, r)]
        for b in blue:
            stage1 += move[(black, b)] * 2
        for r1, r2 in combinations(red, 2):
            stage1 += move[(r1, r2)] * 2
    
        for bixs in [[0, 1, 2, 3], [0, 2, 3, 1], [0, 3, 1, 2]]:
            bl = [blue[bix] for bix in bixs]
            stage2 = (move[(bl[0], bl[1])] +
                      move[(bl[1], bl[2])] +
                      move[(bl[2], bl[3])] +
                      move[(bl[3], bl[0])] +
                      move[(bl[0], bl[2])]*2 +
                      move[(bl[1], bl[3])]*2)*2
            
            for re in permutations(red, 4):
                stage3 = calc_br(bl, re)
                score = stage1 + stage2 + stage3
                #if score == 11:
                #    print(black, bl, re)
                #print(stage1, stage2, stage3)
                if score <= bestscore:
                    if score < bestscore:
                        bestans = "9"*9
                    bestscore = score
                    bestans = min(bestans, fliplr(black, bl, re))
print("".join((map(str, bestans[:3]))))
print("".join((map(str, bestans[3:6]))))
print("".join((map(str, bestans[6:]))))


Measured memory_bytes: 7160
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
//#define repitr(itr, st) for(auto itr = st.begin(); itr != st.end(); ++itr)
#define P_B push_back
#define PO_B pop_back
#define E_B emplace_back
#define M_P make_pair
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << endl
//#define print(x) printf("%d\n", x)

using namespace std;
using ll = long long;
using Pii = pair<int,int>;
using Pll = pair<ll,ll>;
using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<vector<int> >;
using VVL = vector<vector<ll> >;
//int dx[4] = {1, 0, -1, 0};
//int dy[4] = {0, 1, 0, -1};
//const ll LINF = (ll)1e18 - 1;
//const int INF = 1e9 - 1;
//int:±2*10^9くらい　ll:±9*10^18くらい



void Main(){
  int N, S;
  const int MOD = 998244353;
  cin >> N >> S;
  VI A(N);
  rep(i, N) cin >> A[i];

  VI dp(S+1, 0);

  dp[0] = 1;

  rep(i, N){
    VI p(S+1, 0);
    rep(j, S+1){
      p[j] += dp[j] * 2;
      if(p[j] >= MOD) p[j] -= MOD;
      if(j >= A[i]) p[j] += dp[j-A[i]];
      if(p[j] >= MOD) p[j] -= MOD;
    }
    swap(p, dp);
  }

  cout << dp[S] << endl;



}

int main()
{
	cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();

  return 0;
}

Measured memory_bytes: 3660
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, A: "List[int]"):
    ans = 0
    j = 0
    x = 0
    for i in range(N):
        while j < N and (x & A[j]) == 0:
            x ^= A[j]
            j += 1
        ans += j - i
        x ^= A[i]
    print(ans)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()


Measured memory_bytes: 26016
n, k = gets.chomp.split(" ").map(&:to_i)
ans = 0.0
T = 1.0 / n
1.upto(n) do |i|
    j = i
    count = 0
    while j < k
        j *= 2
        count += 1
    end
    harf = 2 ** count
    ans += (1.0 / harf)
end
puts ans * T

Measured memory_bytes: 1788
#include<iostream>
#include<vector>
#include<string.h>
#include<queue>
typedef long long ll;
const ll m = 998244353;
ll v[1000000];
ll ksm(ll a, ll b) {
	ll c = 1;
	while (b) {
		if (b & 1) c = c * a % m;
		a = a * a % m;
		b >>= 1;
	}
	return c;
}

using namespace std;
int main() {
	ll n,x,ma;
	cin >> n;
	int ans = 0,cnt = 0;
	cin >> x;
	for (int i = 1; i < n; i++) {
		cin >> ma;
		if (x >= ma) {
			x = ma;
			cnt++;
		}
		else {
			ans = max(cnt, ans);
			cnt = 0;
			x = ma;
		}
	}
	cout << max(ans,cnt) << '\n';
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace   std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define double    long double
#define ull       unsigned long long
#define mod       1000000007
#define vi        vector<ll>
#define extreme   inline
#define ppi       pair<ll,pair<ll,ll>>
#define pb        push_back
#define mp        make_pair
#define pi        2*acos(0.0)
#define pr(a,x,n) for(int i=x;i<n;i++){cout<<a[i]<<" ";}
#define p(a)      cout<<a;
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define test      cout<<"THIS_AND_THIS"<<endl;
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
void solve(){
	ll n;
	cin>>n;
	ll arr[n];ll a=0;
	for(int i=0;i<n;i++){
		cin>>arr[i];a^=arr[i];
	}
	for(int i=0;i<n;i++){
		cout<<(arr[i]^a)<<" ";
	}
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 5164
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func calc(a, b int, op string) int {
	switch op {
	case "+":
		return a + b
	case "-":
		return a - b
	case "*":
		return a * b
	default:
		panic("unknown operator")
	}
}

func main() {
	reader := bufio.NewReader(os.Stdin)
	st := make([]int, 0, 101)
	line, _ := reader.ReadString('\n')
	line = strings.TrimSpace(line)
	for _, s := range strings.Split(line, " ") {
		if s[0] >= '0' && s[0] <= '9' {
			x, _ := strconv.Atoi(s)
			st = append(st, x)
		} else {
			a, b := st[len(st)-2], st[len(st)-1]
			st = append(st[:len(st)-2], calc(a, b, s))
		}
	}
	fmt.Println(st[len(st)-1])
}



Measured memory_bytes: 1116
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

int main(){
  ll A,B;cin>>A>>B;
  ll C =__gcd(A,B);
  map<ll,int > p;
  for(ll i=2; i*i<=C;i++){
    while(C%i==0){
      C /=i;
      p[i]++;
    }
  }
  if(C!=1)p[C]++;
  cout <<p.size()+1<<endl;
  
}


Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>

#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) (signed)((a).size())
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

const int MOD = 1000000007;

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"  << " " << __FILE__ << endl;

signed main(void) {
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(10);
    cin.tie(0);

    string o,e;
    cin >> o >> e;
    string ans(o.length()+e.length(),0);
    REP(i,o.length()){
        ans[i*2]=o[i];
    }
    REP(i,e.length()){
        ans[i*2+1]=e[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/* Coached by rainboy */
#include <stdio.h>

#define N 300000
#define MD 1000000007

int main() {
	static long long aa[N];
	int n, i, j, k;
	long long ans;

	scanf("%d", &n);
	for (i = 0; i < n; i++)
		scanf("%lld", &aa[i]);
	ans = 0;
	for (j = 0; j < 60; j++) {
		k = 0;
		for (i = 0; i < n; i++)
			if (aa[i] & 1LL << j)
				k++;
		ans = (ans + ((long long) k * (n - k) % MD * ((1LL << j) % MD))) % MD;
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 2560
program BiiteEating
    implicit none
    integer(4)::n, l, i, imin
    integer(4),allocatable:: t(:)

    read*, n,l

    allocate(t(n))
    imin = 1
    do i=1,n
        t(i) = l+i-1
        if (abs(t(i)) < abs(t(imin))) imin = i
    end do

    print*, sum(t) - t(imin)

end program BiiteEating

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <atcoder/all>

#define int long long

#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

using namespace std;
using namespace atcoder;

using P = std::pair<int, int>;
using ll = long long;
using ld = double;

using bint = boost::multiprecision::cpp_int;


template<typename T, typename U>
std::istream& operator>>(std::istream& in, std::pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

const int MOD = 1e9 + 7;

// https://twitter.com/vane11ope ←フォローしましょう
// (ノ)>◡<(ヾ)ﾓﾁﾓﾁ
signed main(signed argc, char* argv[]) {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int n,q;
    cin>>n>>q;

    dsu tree(n);
    rep(i,q){
        int t,u,v;
        cin>>t>>u>>v;
        if(t==0){
            tree.merge(u,v);
        }
        else{
            cout<<tree.same(u,v)<<endl;
        }
    }
}


Measured memory_bytes: 3912
#include <iostream>
#include <string.h>

using namespace std;

int main () {
    int i,l;
    char s[51];
    cin >> s;
    l = strlen(s);
    for (i=0;i<l-8;i++){
        cout <<s[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long
#define ll  long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define ub upper_bound
#define lb lower_bound
#define BS binary_search
#define all(c) (c).begin(),(c).end()
#define deb(a) cout<<#a<<" "<<a<<endl
#define WW 100000
#define INF 1000000000000000000 //1e18
#define EPS 0.000000001 //1e-9
//get<a>(t) gives ath element of tuple named t, numbering starts from 0
//max({_,......,_}) can give maximum of any number of elements. Similarly min also.
//don't forget to initialise freq arrays
//reverse(all(v)) would reverse a vector  
//pow(10.0, 2.0) can give exactly 100.0, slightly greater, or slightly less. 
//Therefore use(int)(pow(10.0,zz)+EPS)
int32_t main()
{
	IOS;
	int n,w; cin>>n>>w;
	int W[n+1]={},V[n+1]={};
	for(int i=1;i<=n;i++)
	{
		cin>>W[i]>>V[i];
	}
	//deb(W[0]);
	int dp[n+1][w+1]={};
	for(int i=0;i<=n;i++)
	{
		for(int j=0;j<=w;j++)
		{
			if(i==0 or j==0)
				dp[i][j]=0;
			else if(W[i]>j)
				dp[i][j]=dp[i-1][j];
			else
				dp[i][j]=max(dp[i-1][j] , V[i]+dp[i-1][j-W[i]] );

		}

	}
	/*for(int i=0;i<=n;i++)
	{	for(int j=0;j<=w;j++)
			cout<<dp[i][j]<<" ";
		cout<<endl;
	}*/
	cout<<dp[n][w];
	return 0;
}

Measured memory_bytes: 79232
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using P = pair<int,int>;
using ll = long long;
static const int INF = 1000000000;
static const ll MOD = 1000000007;

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];

  sort(a.begin(), a.end());

  if(a[0] != 0){
    ll ans = 1e18;
    rep(i, n){
      ans /= a[i];
      if(ans == 0){
        cout << -1 << endl;
        return 0;
      }
    }
  }
  ll ans = 1;
  rep(i, n){
    ans *= a[i];
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3992
#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>;
using Graph = vector<vector<int>>;
int main(int argc, const char * argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int d,t,s;
    cin>>d>>t>>s;
    if(d<=t*s)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 3648
var
    n, v, min, cnt, i:integer;
begin
    read(n);
    cnt := 0;
    min := n + 1;
    for i := 1 to n do begin
        read(v);
        if v < min then begin
            cnt := cnt+1;
            min := v;
        end;
    end;
    writeln(cnt);
end.

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define pi pair<int,int>
#define endl "\n"
using namespace std;
int main(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	ll cnt=1,ans=0;
	for(ll i=100;i<n;i*=1.01){
		ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()),((v).end())
#define ll long long
#define fastIO cout << fixed << setprecision(12), ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
double const EPS = 1e-12, PI = acos(-1);
const int N = 1e6 + 9, M = 1e7 + 9, OO = 1e9 + 7, MOD = 1e9 + 7, MOD2 = 998244353;
const ll inf = 1e18;

int ans[109][109];

int main() {
	fastIO;
#ifdef LOCAL
//	freopen("input.in", "rt", stdin);
#endif
	int n, m, q, a;
	cin >> n >> m >> q;
	bool dir = 1;
	int r = 1, c = 1;
	for (int i = 0; i < q; ++i) {
		cin >> a;
		for (int j = 0; j < a; ++j) {
			ans[r][c] = i + 1;
			if(dir) ++c;
			else --c;
			if(c == m + 1) {
				c = m;
				dir = 0;
				++r;
			} else if(c == 0) {
				c = 1;
				dir = 1;
				++r;
			}
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= m; ++j)
			cout << ans[i][j] << ' ';
		cout << '\n';
	}
	return 0;
}


Measured memory_bytes: 384
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		int i;
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int length = sc.nextInt();
		List<String> abc = new ArrayList<String>();
		for(i=0;i<number;i++) {
			abc.add(sc.next());
		}
		Collections.sort(abc);
		String result = String.join("", abc);
		System.out.println(result);
	}
}

Measured memory_bytes: 23252
N,M = map(int, input().split())
#N = int(input())
#S = input()

#sum=0

#List = ['A','B','C','D','E']
List_H = list(map(int,input().split()))

List_hashi = [0 for i in range(N)]


#print(List_H)


#行列入力
for i in range(M):
    A,B= map(int, input().split())
    if List_H[A-1] >= List_H[B-1]:
        List_hashi[B-1] = -1
    if List_H[A-1] <= List_H[B-1]:
        List_hashi[A-1] = -1


#print(List_A_all)

print(List_hashi.count(0))

Measured memory_bytes: 20032
def index(c):return ord(c)-ord('A')+1
s=' '+input()
m=10**9+7
dp=[[0]*4 for _ in range(len(s))]
dp[0][0]=1
for i in range(1,len(s)):
    for j in range(4):
        dp[i][j]=dp[i-1][j]
    if s[i]=='?':
        dp[i][0]=dp[i-1][0]*3%m
        for j in range(1,4):
            dp[i][j]=(dp[i-1][j-1]+dp[i-1][j]*3)%m
    else:
        k=index(s[i])
        dp[i][k]=(dp[i-1][k-1]+dp[i-1][k])%m
print(dp[-1][3])

Measured memory_bytes: 55660
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int x=1;
		int n=1;

		while((x = sc.nextInt()) != 0){
			System.out.printf("Case %d: %d\n",n, x);
			n++;
		}
	}

}



Measured memory_bytes: 60864
if __name__ == '__main__':
    S=input()
    i=0
    j=len(S)
    if j%2==0:
        for l in range(0,len(S),2):
            i=0
            if(S[l]=='h' and S[l+1]=='i'):
                i=1
    if i==1:
        print('Yes')
    else:
        print('No')


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef std::vector<vector<int> > vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
#define debugone(x) cerr << #x << " " << x << "\n"; cerr.flush();
#define debugtwo(x) cerr << #x << "-------------" << "\n";for(auto &it: x) cerr << it << " ";cerr << "\n"; cerr.flush();
#define debugthree(x_, i_, j_) cerr << #x_ << "------------" << "\n";cerr << "from " << i_ << " to " << j_ << "\n";for(ll k_=i_; k_<=j_; k_++) cerr << x_[k_] << " ";cerr << "\n"; cerr.flush();
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

const ll MOD = 1e9 + 7;
const int INF = 2e9;
const int MAX_LOG = 21;
const int MAX_N = 12800;

#define forn(i, n) for(int i = 0; i < n; i++)
#define forsn(i, s, n) for(int i = s; i < n; i++)

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int a, b;
	cin >> a >> b;
	forsn(i, 1, 4){
		if(i != a && i != b){
			cout << i << endl;
			return 0;
		}
	}
}		

Measured memory_bytes: 256
#include<stdio.h>

int main(){
    char s[10];
    scanf("%s",s);
    switch(s[0]){
        case 'S':
            printf("Cloudy\n");
        break;
        case 'C':
            printf("Rainy\n");
        break;
        case 'R':
            printf("Sunny");
            break;
    }
    return 0;
}

Measured memory_bytes: 128
/*
AizuOnline A0066
Title tic tac toe
*/
#include <stdio.h>
// Select Below
//#include <stdlib.h>
#include <string.h>
//#include <float.h>
//#include <math.h>
//#include <limits.h>
//Global data section
char ban[10];
//
main()
{

  while(NULL != gets(ban))
    {
      if(ban[0]=='o' && ban[1]=='o' && ban[2]=='o')
	printf("o\n");
      else if(ban[3]=='o' && ban[4]=='o' && ban[5]=='o')
	printf("o\n");
      else if(ban[6]=='o' && ban[7]=='o' && ban[8]=='o')
	printf("o\n");
      else if(ban[1]=='o' && ban[4]=='o' && ban[7]=='o')
	printf("o\n");
      else if(ban[2]=='o' && ban[5]=='o' && ban[8]=='o')
	printf("o\n");
      else if(ban[0]=='o' && ban[3]=='o' && ban[6]=='o')
	printf("o\n");
      else if(ban[0]=='o' && ban[4]=='o' && ban[8]=='o')
	printf("o\n");
      else if(ban[2]=='o' && ban[4]=='o' && ban[6]=='o')
	printf("o\n");
      else if(ban[0]=='x' && ban[1]=='x' && ban[2]=='x')
	printf("x\n");
      else if(ban[3]=='x' && ban[4]=='x' && ban[5]=='x')
	printf("x\n");
      else if(ban[6]=='x' && ban[7]=='x' && ban[8]=='x')
	printf("x\n");
      else if(ban[1]=='x' && ban[4]=='x' && ban[7]=='x')
	printf("x\n");
      else if(ban[2]=='x' && ban[5]=='x' && ban[8]=='x')
	printf("x\n");
      else if(ban[0]=='x' && ban[3]=='x' && ban[6]=='x')
	printf("x\n");
      else if(ban[0]=='x' && ban[4]=='x' && ban[8]=='x')
	printf("x\n");
      else if(ban[2]=='x' && ban[4]=='x' && ban[6]=='x')
	printf("x\n");
      else
	printf("d\n");
      memset(ban,'\0',0);
    }
return(0);
}

Measured memory_bytes: 520
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pa pair<int,int>
const int Maxn=3010;
const int inf=2147483647;
int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return x*f;
}
int n,mod;
int fac[Maxn],fin[Maxn],inv[Maxn],s[Maxn][Maxn];
void pre()
{
	fac[0]=1;
	for(int i=1;i<=n;i++)fac[i]=(LL)fac[i-1]*i%mod;
	inv[0]=inv[1]=1;
	for(int i=2;i<=n;i++)inv[i]=(LL)(mod-mod/i)*inv[mod%i]%mod;
	fin[0]=1;
	for(int i=1;i<=n;i++)fin[i]=(LL)fin[i-1]*inv[i]%mod;
	s[0][0]=1;
	for(int i=1;i<=n+1;i++)
	{
		s[i][0]=0;
		for(int j=1;j<=i;j++)
		s[i][j]=(LL)(s[i-1][j-1]+(LL)j*s[i-1][j]%mod)%mod;
	}
}
int C(int n,int m)
{
	if(n<m)return 0;
	return (LL)fac[n]*fin[m]%mod*fin[n-m]%mod;
}
int Pow(int x,int y,int mod)
{
	if(!y)return 1;
	if(y==1)return x;
	int t=Pow(x,y>>1,mod),re=(LL)t*t%mod;
	if(y&1)re=(LL)re*x%mod;
	return re;
}
int main()
{
	n=read(),mod=read();
	pre();
	int ans=0;
	for(int i=0;i<=n;i++)//i位不合法 
	{
		int t=0,tmp=Pow(2,n-i,mod);
		for(int j=0;j<=i;j++)//1分到j个数 
		t=(LL)(t+(LL)Pow(tmp,j,mod)*s[i+1][j+1]%mod)%mod;
		t=(LL)t*Pow(2,Pow(2,n-i,mod-1),mod)%mod*C(n,i)%mod;
//		printf("%d\n",t);
		if(i&1)ans=(ans-t+mod)%mod;
		else ans=(ans+t)%mod;
	}
	printf("%d",ans);
}

Measured memory_bytes: 34304
#include "bits/stdc++.h"
using namespace std;
#define int               long long
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll

template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}

const long long INF=1e18;
const int32_t M=1e9+7;
const int32_t MM=998244353;

const int N=0;



void solve(){
	int n;
	int ans = 0;
	cin>>n;
	rep(i,1,n+1){
		int a;
		cin>>a;
		if(i%2 && a%2) ans++;
	}
	cout<<ans;
}
signed main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#ifdef SIEVE
		sieve();
	#endif
	#ifdef NCR
		init();
	#endif
	int t=1;
	//cin>>t;
	while(t--) solve();
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <map>
using namespace std;
const long mod = 1000000007;
int main()
{
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 2; i <= N; i++)
  {
    int n = i;
    for (int j = 2; j * j <= n; j++)
    {
      while (n % j == 0)
      {
        mp[j]++;
        n /= j;
      }
    }
    if (n != 1)
      mp[n]++;
  }
  long ans = 1;
  for (auto m : mp)
  {
    ans *= m.second + 1;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256