akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[9]={1,0,-1,0,1,1,-1,-1,0};
const ll dx[9]={0,-1,0,1,1,-1,1,-1,0};
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;
}
double mem[310][310][310];
ll n;
double dfs(ll x,ll y,ll z){
    if(x<0||y<0||z<0)return 0;
    if(mem[x][y][z]!=-1)return mem[x][y][z];
    double ret=n;
    ret+=x*dfs(x-1,y,z);
    ret+=y*dfs(x+1,y-1,z);
    ret+=z*dfs(x,y+1,z-1);
    ret/=x+y+z;
    mem[x][y][z]=ret;
    return ret;
}
int main(){
    cin >> n;vl v(3);
    rep(i,n){
        ll a;cin >> a;v[a-1]++;
    }
    rep(i,310)rep(j,310)rep(k,310){
        //if(i>v[0]+v[1]+v[2]||j>v[1]+v[2]||k>v[2])mem[i][j][k]=0;
        mem[i][j][k]=-1;
    }
    mem[0][0][0]=0;
    CST(12);
    cout << dfs(v[0],v[1],v[2]) <<endl;
    /*rep(i,4){
        rep(j,4){
            rep(k,4){
                cout << mem[i][j][k]<<" ";
            }
            cout << endl;
        }
        cout << endl;
    }*/
}

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

#define ONLINE_JUDGE
#define ll long long
#define PI 3.14159265359
#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
#define pb(a) push_back(a)

//////////// Solution /////////////////////////////////

const int MAX = 1e5+1;

int pows[MAX];

void solve() {
	int n,k;
	cin >> n >> k;

	for (int i = 1; i < k; ++i) {
		int j = 0;
		while (i*(1<<j) < k) {
			++j;
		}
		pows[i] = j;
		//cout << j << ' ';
	}
	//cout << '\n';

	double ans = 0;
	for (int i = 1; i <= min(k-1,n); ++i) {
		double coef = 1;
		for (int j = 0; j < pows[i]; ++j) {
			coef *= 0.5;
		}
		ans += 1.0/n * coef;
	}
	
	ans += max(0,n-k+1) * 1.0/n;

	cout << fixed << setprecision(12) << ans << '\n';
}


/////////// End Solution ///////////////////////////////////////

//////// Initialization ////////////////////////////////////

int main() {

	#ifndef ONLINE_JUDGE
	FILE *FIN = freopen("/home/danil/prog/input.txt", "r", stdin);
	clock_t time_start = clock();
	#endif

	ios::sync_with_stdio(false);
	cin.tie(NULL);

	solve();

	#ifndef ONLINE_JUDGE
	fclose(FIN);
	cerr << "\x1b[031m\n-----------------\nTime=" << (ll)((double)(clock()-time_start) / CLOCKS_PER_SEC * 1000) << "ms\n\x1b[0m";
	#endif

	return 0;
}

//////// End Initialization ///////////////////////////////////////

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

#define int long long

signed main() {
    
    int N, M;
    cin >> N >> M;
    
    vector<vector<int>> list;
    list.resize(N);
    
    int x, y, z;

    for(int i = 0; i < N; ++i){
        list[i].resize(3);
        cin >> x >> y >> z;
        list[i] = {x, y, z};
    }
    
    int ans = 0;
    int num = 0;
    vector<int> temp;
    
    for(int c = 0; c < 8; ++c){
        num = 0;
        for(int i = 0; i < N; ++i){
            temp.push_back(
                           ((c & 1) * 2 - 1) * list[i][0] + (((c >> 1) & 1) * 2 - 1) * list[i][1] + (((c >> 2) & 1) * 2 - 1) * list[i][2]);
        }
        sort(temp.begin(), temp.end());
        
        for(int i = N - 1; i >= N - M; --i){
            num += temp[i];
        }
        
        if(num > ans){
            ans = num;
        }
        
        temp.clear();
    }
    cout << ans << endl;
}

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

string s;

int main()
{
	int ans = 0;

	cin >> s;

	for( int i = 0; i < 3; i++ ) {
		if(s[i] == '1' ) {
			ans++;
		}
	}


	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
n = gets.to_i
a = gets.to_i
b = gets.to_i
c = gets.to_i
d = gets.to_i
e = gets.to_i

bottleneck = [a, b, c, d, e].min

bottleneck_count, mod = n.divmod(bottleneck)
bottleneck_count += 1 unless mod.zero?

puts bottleneck_count + 4


Measured memory_bytes: 1788
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int N = stdIn.nextInt();        
        int[] vote = new int[N];
        int[] A = new int[N - 1];      
        for (int i = 0; i < N - 1; i++) {
            A[i] = stdIn.nextInt();
            vote[A[i] - 1]++;
        }
        stdIn.close();
        for (int i = 0; i < N; i++) {
            System.out.println(vote[i]);
        }

    }
}

Measured memory_bytes: 57352
import java.util.Scanner;

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

    final long M = 1_000_000_007;
    int n = scanner.nextInt();
    int m = scanner.nextInt();
    int[] x = new int[n];
    int[] y = new int[m];
    for (int i = 0; i < n; i++) x[i] = scanner.nextInt();
    for (int i = 0; i < m; i++) y[i] = scanner.nextInt();

    System.out.println(compute(x, M) * compute(y, M) % M);
  }

  private static long compute(int[] a, long mod) {
    long ans = 0;
    int n = a.length;
    for (int i = 1; i < n; i++) {
      long d = ((long) a[i] - a[i - 1]) % mod;
      d *= i;
      d %= mod;
      d *= (n - i);
      d %= mod;
      ans += d;
      ans %= mod;
    }
    return ans;
  }
}


Measured memory_bytes: 89140
#include<bits/stdc++.h>
using namespace std;
using lli = long long;
#define rep(i,n) for(int i=0;i<n;i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

lli n, h;

int main(void){
    cin >> n >> h;
    vector<lli> a(n), b(n);
    rep(i, n) cin >> a[i] >> b[i];
    lli ma = *max_element(a.begin(), a.end());
    sort(b.rbegin(), b.rend());
    lli ans = 0;
    rep(i, n){
        if(b[i] <= ma) break;
        h-=b[i];
        ans++;
        if(h <= 0) break;
    }
    if(h > 0) ans+=(h+ma-1)/ma;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4792
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
 
ll power(ll a, ll b){//a^b
    ll res=1;
    while(b>0){
        if(b&1){res=(res*a);b--;}
        a=(a*a);
        b>>=1;
    }
    return res;
}

ll gcd(ll a, ll b){return (b==0)?a:gcd(b,a%b);}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	if(a==0)
		cout<<"1\n";
	else if(b==0)
		cout<<"2\n";
	else if(c==0)
		cout<<"3\n";
	else if(d==0)
		cout<<"4\n";
	else
		cout<<"5\n";
}

Measured memory_bytes: 3596
r,g,b,n = map(int,input().split())
res = 0
for rr in range(0, n // r + 1):
    for gg in range(0, (n - rr) // g + 1):
        if (n - r*rr - g*gg) < 0:
            break
        if (n - r*rr - g*gg) % b == 0:
            res += 1
print(res)


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

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

using ll = long long;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }

int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  int n; std::cin >> n;
  std::vector<ll> a(n), b(n);
  rep(i,n) {
    ll x, y; std::cin >> x >> y;
    a[i] = x+y;
    b[i] = x-y;
  }

  std::sort( all(a) );
  std::sort( all(b) );

  ll ans = -1e18;
  ans = std::max(ans, std::abs(a.back() - a.front()) );
  ans = std::max(ans, std::abs(b.back() - b.front()) );
  std::cout << ans << std::endl;

  return 0;
}



Measured memory_bytes: 6372
#include<stdio.h>

int main(){
  int i, n, s;

  while (1) {
    scanf("%d", &n);
    if (n==0) {
      break;
    }
    int ans = 0, maxv = 0, minv = 1000;
    int score[n];
    for (i = 0; i < n; i++) {
      scanf("%d", &s);
      if (s > maxv) {
        maxv = s;
      }
      if (s < minv) {
        minv = s;
      }
      score[i] = s;
    }

    for (i = 0; i < n; i++) {
      ans += score[i];
    }

    printf("%d\n", (ans-maxv-minv)/(n-2));
  }
  return 0;
}

Measured memory_bytes: 2596
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double PI = 3.1415926535897932;

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}


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

	bool find = false;
	for (int i = 0; i < s.length(); ++i)
	{
		if (s[i] == '7')
		{
			find = true;
		}
	}

	if (find) {
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

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

void gcd(int a, int b, int step);

int main()
{
	int a, b;

	while (cin >> a >> b, a){
		gcd(a, b, 0);
	}

	return (0);
}

void gcd(int a, int b, int step)
{
	if (b == 0){
		cout << a << " " << step << endl;
	}
	else if (a < b){
		gcd(a, b % a, step + 1);
	}
	else {
		gcd(b, a % b, step + 1);
	}
}

Measured memory_bytes: 1160
s = input()
n = int(input())

for i in range(n):
    command = input().split()
    if command[0] == 'replace':
        a,b = map(int,command[1:3])
        s = s[:a]+ command[3] + s[b+1:]
    elif command[0] == 'reverse':
        a,b = map(int,command[1:3])
        s = s[0:a] + s[a:b+1][::-1] + s[b+1:]
    elif command[0] == 'print':  
        a,b = map(int,command[1:3])
        print(s[a:b+1])


Measured memory_bytes: 5608
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
#include<atcoder/all>

using namespace atcoder;
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please
const int SZ = 500000;
class UF {
public:
	int P[SZ + 1];
	UF() : P() {
		rep1(i, SZ) P[i] = -1;
	}
	int find(int A) {
		if (P[A] < 0) return A;
		return P[A] = find(P[A]);
	}
	bool unite(int A, int B) {
		int a = find(A);
		int b = find(B);
		if (a == b) return false;
		if (P[a] > P[b]) swap(a, b);
		P[a] += P[b];
		P[b] = a;
		return true;
	}
} uf;

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


	int N, M;
	cin >> N >> M;

	int kotae = N - 1;
	rep(i, M) {
		int a, b;
		cin >> a >> b;
		kotae -= uf.unite(a, b);
	}

	co(kotae);

	Would you please return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	string S,T;		cin>>S>>T;
	cout<<T+S<<endl;

    return 0;
}




Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<cstdio>
#include<numeric>
using namespace std;
using ll = long long;
int main(){
  int n;
  cin >> n;
  int q = 0;
  int cnt = 0;
  int left = 0, right = n;
  vector<int> es(n);
  while(true) {
    cout << q << endl;
    string tmp;
    cin >> tmp;
    if(tmp == "Vacant"){
      return 0;
    }else if(tmp =="Male"){
      if(cnt == 0) {
        for(int i = 0; i < n; i++){
          if(i % 2 == 0){
            es[i] = 0;
          }else{
            es[i] = 1;
          }
        }
      } else {
        if(es[q] == 0){
          left = q;
        } else {
          right = q;
        }
      }
    }else{
      if(cnt == 0) {
        for(int i = 0; i < n; i++){
          if(i % 2 == 0){
            es[i] = 1;
          }else{
            es[i] = 0;
          }
        }
      } else {
        if(es[q] == 1){
          left = q;
        } else {
          right = q;
        }
      }
    }
    q = (left + right) / 2;
    cnt++;
  }
  return 0;
}

Measured memory_bytes: 1236
#include <iostream>
#include <vector>
#include <set>
#include <array>
#include <list>
#include <string>
#include <algorithm>
#include <queue>
#include <numeric>
#include <random>
#include <iomanip>
#include <chrono>

using namespace std;


int main() {

	string s, t;
	cin >> s >> t;

	int a, b;
	cin >> a >> b;

	string u;
	cin >> u;

	if (u == s) a--;
	else b--;

	cout << a << " " << b << endl;

	return 0;
}


Measured memory_bytes: 888
M, D = map(int, input().split())

cnt = 0
for m in range(1, M+1):
    for d in range(10, D+1):
        d10, d1 = divmod(d, 10)
        if d10 < 2 or d1 < 2:
            continue
        if d1 * d10 == m:
            cnt += 1

print(cnt)


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

using namespace std;

int main() {
    int N, A;
    cin >> N;
    map<int, int> M;
    long long ans = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> A;
        ans+=M[i-A];
        M[A+i]++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 20604
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
long long dp[1000001][200]; long long h;

long long knap(long long a[][2],long long w,long long i)
{


if (w < 0)
		return INT_MIN;
   
    
    if(i<0||w==0)
    {
     return 0;
    }
   
  if(dp[w][i]==0)
    {  
         h=max(a[i][1]+knap(a,w-a[i][0],i-1),knap(a,w,i-1));
         dp[w][i]=h;
    }
    return dp[w][i];
}

int main() {
    long long n,w;
    cin>>n>>w;
    long long a[n][2];
 
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<2;j++)
        {
            cin>>a[i][j];
            
        }
    }
    long long o=knap(a,w,n-1);
    cout<<o;
    
    
	return 0;
}



Measured memory_bytes: 157952
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        long output = (long)a*c;
        output = Math.max(output, (long)a*d);
        output = Math.max(output, (long)b*c);
        output = Math.max(output, (long)b*d);
        
        System.out.println(output);
        
    }
}


Measured memory_bytes: 35728
N = int(input())
a = list(map(int, input().split()))
a_sum = 0
for i in range(len(a)):
    a_sum = a_sum ^ a[i]
anslist = []
for i in range(len(a)):
    anslist.append(str(a_sum ^ a[i]))
print(" ".join(anslist))

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

int main(){
  int a,b;  cin >> a >> b;
  int sa = b-a;
  int sum=0, t=0;
  for(int i=1; i<=sa; i++){
    t=+i;
    sum += t;
    t=sum;
  }
  cout << sum-b << endl;
}  

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

using namespace std;

typedef pair<int,int> P;
typedef long long ll; 

#define int ll

main(){
	ll n;
	cin >> n;

	ll ans = 0;
	for(ll i=1;i<=n;i++){
		ans += (n/i)*((n/i)+1)*i/2;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3560
from collections import deque

N = int(input())
H = deque(map(float, input().split()))

ato = H.pop()

if N == 1:
    print('Yes')
    exit()

for i in range(N-1, 0, -1):
    mae = H.pop()
    if ato - mae < -1:
        print('No')
        exit()
    elif ato - mae == -1:
        ato = mae - 1
    else:
        ato = mae

print('Yes')


Measured memory_bytes: 13732
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>
#include<map>

using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
typedef pair<int,int> P;
const int inf=1000000007;
const int MOD=1000000007;
struct Node{
    int no;
    int par;
    int white=1;
    int black=1;
    vector<Node*> child;
    void build(int i){
        no=i;
        par=i;
        white=1;
        black=1;
    }
};
struct Tree{
    int n;
    vector<Node> node;
    Tree(int k){
        n=k;
        node.resize(n+1);
        for(int i=1;i<=n;++i){
            node[i].build(i);
        }
    }
    void input(int k){
        for(int i=0;i<k;++i){
            int a,b;cin>>a>>b;
            node[a].child.push_back(&node[b]);
            node[b].child.push_back(&node[a]);
        }
    }
    void BFS(int s){
        queue<Node> que;
        que.push(node[s]);
        while(!que.empty()){
            Node buf=que.front();que.pop();
            int num=buf.child.size();
            for(int i=0;i<num;++i){
                if(buf.child[i]->no!=buf.par){
                    buf.child[i]->par=buf.no;
                    que.push(*buf.child[i]);
                }
            }
        }
    }
    void DFS(Node& node){
        if(node.child.size()==1&&node.par!=node.no){
            return;
        }
        else{
            int num=node.child.size();
            for(int i=0;i<num;++i){
                if(node.child[i]->no!=node.par){
                    DFS(*node.child[i]);
                    node.white*=node.child[i]->white+node.child[i]->black;
                    node.black*=node.child[i]->white;
                    node.white%=MOD;
                    node.black%=MOD;
                }
            }
        }
    }
};
signed main(){
  int n;cin>>n;
  Tree tree(n);
  tree.input(n-1);
  tree.BFS(1);
  tree.DFS(tree.node[1]);
  cout<<(tree.node[1].white+tree.node[1].black)%MOD<<"\n";
  return 0;
}

Measured memory_bytes: 19172
import math
N = int(input())

def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

for i in range(N, 10**6):
    if is_prime(i):
        print(i)
        break

Measured memory_bytes: 3060
using System;

public class hello
{
    public static void Main()
    {
        while (true)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var n = int.Parse(line[0]);
            var p = int.Parse(line[1]);
            if (n == 0 && p == 0) break;
            Console.WriteLine(PlayGame(n, p));
        }
    }
    public static int PlayGame(int n, int p)
    {
        var kouho = new int[n];
        var ksum = 0;
        var np = 0;
        while (true)
        {
            if (p == 0) { p += kouho[np]; ksum -= kouho[np]; kouho[np] = 0; }
            else if (p == 1 && ksum == kouho[np]) { return np; }
            else { kouho[np]++; ksum++; p--; }
            np++; if (np == n) np = 0;
        }
    }
}


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

int main()
{
    int n, m;
    cin >> n >> m;

    vector<pair<int, char>> ruleMap;
    for (int i = 0; i < m; ++i)
    {
        int digitNum;
        char ruleNum;
        cin >> digitNum >> ruleNum;

        ruleMap.push_back(make_pair(digitNum, ruleNum));
    }

    int numMinLim, numMaxLim;
    if (n == 1)
    {
        numMinLim = 0;
        numMaxLim = 9;
    }
    else if (n == 2)
    {
        numMinLim = 10;
        numMaxLim = 99;
    }
    else
    {
        numMinLim = 100;
        numMaxLim = 999;
    }

    int minNum = -1;
    for (int num = numMinLim; num <= numMaxLim; ++num)
    {
        bool isOk = true;
        string numInStr = to_string(num);
        for (const auto &singleRule : ruleMap)
        {
            if (numInStr.at(singleRule.first - 1) != singleRule.second)
            {
                isOk = false;
                break;
            }
        }

        if (isOk)
        {
            minNum = num;
            break;
        }
    }

    cout << minNum << endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
d = []
a = []
count = 0
for i in range(k):
    d += map(int, input().split())
    a += map(int, input().split())
check = set(a)
for j in range(1, n+1):
    if j not in check:
        count += 1
print(count)


Measured memory_bytes: 9164
//Author rahuliitkgp

/*A thing of beauty is a joy forever,
Its loveliness increases,
it will never pass into nothingness.*/
//Men at Work :)

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;

#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

void cpp(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

int main(){
    cpp();
    ll n;
    cin>>n;
    cout<<n+n*n+n*n*n<<endl;
    return 0;
}




Measured memory_bytes: 3620
while True:
  n = int(input())
  if not n:
    break
  m = int(input())
  edge = [[0 for i in range(n + 1)] for j in range(n + 1)]
  for i in range(m):
    a,b = map(int,input().split())
    edge[a][b] = 1
    edge[b][a] = 1
  friends1 = {i for i in range(n + 1) if edge[1][i]}
  friends2 = set()
  for friend in friends1:
    friends_lst = {i for i in range(n + 1) if edge[friend][i]}
    friends2 = friends2 | friends_lst
#  print(friends1 | friends2)
  ans = len(friends1 | friends2)
  if ans:
    ans -= 1
  print(ans)



Measured memory_bytes: 8052
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
 
int main() {
    long long a,b;
    cin >>a >>b;
    long long x, r, tmp;
    long long ans;

    x = a*b;
    if(a>b){
        tmp = a;
        a = b;
        b = tmp;
    }

    r= a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }

    ans = x/b;
    cout << ans <<endl;

  return 0;
}

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

typedef long long llong;
const int maxn=1e5+10;

int N;
int A[maxn],B[maxn];

int main()
{
    scanf("%d",&N);
    for(int i=0;i<N+1;i++)
        scanf("%d",A+i);
    for(int i=0;i<N;i++)
        scanf("%d",B+i);
    llong ans=0ll;
    for(int i=0;i<N;i++)
    {
        if(B[i]>=A[i]+A[i+1])
        {
            ans+=A[i]+A[i+1];
            A[i+1]=0;
        }
        else
        {
            ans+=B[i];
            if(B[i]>A[i])
                A[i+1]=A[i+1]-(B[i]-A[i]);
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
const int maxn=5e5+1;
typedef long long ll;
string to_bin(ll n){
    string res="";
    while (n){
        if (n&1)
            res+='1';
        else
            res+='0';
        n>>=1ll;
    }
    reverse(res.begin(),res.end());
    return res;
}
int col=0;
string dfs(ll n,int cur){
    if (n==1)
        return "";
    col++;
    if (n&1)
        return to_string(cur)+" "+dfs(n-1,cur-1);
    return dfs(n>>1,cur-1)+" "+to_string(cur);
}
int main(){
  //  ios_base::sync_with_stdio(0);
  //  cin.tie(0);
  //  cout.tie(0);
 //   freopen("output.txt","w",stdout);

    ll n;
    cin>>n;
    string cur=dfs(n+1,100);
    string ans="";
    for(int i=0; i<col; ++i)
        ans=to_string(100-i)+" "+ans;
    ans=cur+" "+ans;
    cout<<2*col<<"\n";
    cout<<ans;
}


Measured memory_bytes: 256
import sys
n,a,b=map(int,input().split())
i=0
while(1):
  if(i%2==0):
    if(a+1==b):
      print("Borys")
      sys.exit()
    else:a+=1
  elif(i%2==1):
    if(b-1==a):
      print("Alice")
      sys.exit()
    else:b-=1
  i+=1
  

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const long long M=1e18;
int main()
{
  int A[3];
  cin>>A[0]>>A[1]>>A[2];
  sort(A,A+3);
  if(A[0]==5&&A[1]==5&&A[2]==7) 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++)
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

int n;

char b[900][900];

int main() {
    cin >> n;
    rep(i,n) {
        rep(j,n) {
            cin >> b[i][j];
            rep(u,3) rep(v,3) b[i+n*u][j+n*v] = b[i][j];
        }
    }
    int ans = 0;
    for (int i = n; i < 2*n; i++) {
        bool ok = true;
        rep(j,n) for (int k = j+1; k < n; k++) {
            if (b[i+j][n+k] != b[i+k][n+j]) {
                ok = false;
                break;
            }
        }
        if (ok) {
            ans += n;
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
//#include "testlib.h"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define int long long
#define ll long long
#define M 1000000007
#define MM 998244353
#define inputarr(a,n) for(int i=0;i<n;++i) cin>>a[i]
#define GCD(m,n) __gcd(m,n)
#define LCM(m,n) m*(n/GCD(m,n))
#define mii  map<ll ,ll >
#define sz(a) (int)a.size()
#define msi  map<string,ll >
#define rep(a,b)    for(ll i=a;i<b;i++)
#define rep0(n)    for(ll i=0;i<n;i++)
#define repi(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define vi vector<ll>
#define vs vector<string>
#define ppb pop_back
#define endl '\n'
#define asdf ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define r0 return 0;
#define FORD(i, a, b) for (int i = (int) (a); i >= (int) (b); --i)
#define inputoutput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define Set(a, s) (a, s, sizeof (a))
#define FOR repi
#define pii pair<int,int>
#define REVERSE(v) reverse(all(v))
#define trav(a, x) for(auto& a : x)
#define display(x) trav(a,x) cout<<a<<" ";cout<<endl
#define debug cerr<<"bhau"<<endl
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
template<typename T, typename U> static inline void amin(T &x, U y) 
{ 
    if (y < x) 
        x = y; 
}
template<typename T, typename U> static inline void amax(T &x, U y) 
{ 
    if (x < y) 
        x = y; 
}
 
ll max(ll a, ll b) { return (a > b)? a : b;}
int min(int a, int b) { return (a < b)? a : b;} 


int solve(){

	string s;cin>>s;
	if(s[2]==s[3] && s[4]==s[5]) cout<<"Yes";
	else cout<<"No";


    return 0;
}
signed main(){
    asdf
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
  long int n,a,b,count=0;
  long int c,d;
  cin>>n>>a>>b;
  for(int i=0;i<n;i++){
    cin>>c>>d;
    if(c>=a and b<=d)
      count++;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n,x,tmp;
	cin>>n>>x;
	tmp=x;
	for(int i=0;i<4;i++){
		cin>>x;
		tmp=min(tmp,x);
	}
	cout<<(n-1)/tmp+5;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const int inf=1000000000;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int f[MAX_N]={};
int b[MAX_N]={};

int r[2002][2002]={};
int l[2002][2002]={};
int u[2002][2002]={};
int d[2002][2002]={};
bool s[2002][2002]={};

int main() {
	int n,l;
	cin>>n>>l;
	int res=(n*l+(n*(n+1))/2-n);
	if((l>0)){
		res-=l;
	}
	if(l<(1-n))res-=(l+n-1);
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
#define ll long long
 long double PI = 3.14159265358979323846264338327950L;
int main()
{ios_base::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
 // #ifndef ONLINE_JUDGE
// 	freopen("input.txt" , "r" , stdin);
// 	freopen("output.txt" , "w" , stdout);
// #endif
long double a,b,h,m;
cin>>a>>b>>h>>m;
    long double hr = 0.5 * (h * 60 + m);
long double mr = 6.0 * m;
long double arg = abs(hr-mr);
    arg = min(360.0L-arg,arg);
long double res = sqrtl(a*a+b*b-2*a*b*cosl(arg/180.0L*PI));
cout<<fixed<<setprecision(20)<<res;
return 0;}


Measured memory_bytes: 4124
$swap = 0

def Swap(a, b)
	$swap += 1
	return b,a
end

gets
d = gets.chomp.split(" ").map &:to_i

(d.length-1).times { |i|
	(d.length-1).step(i+1, -1) { |j|
		d[j],d[j-1] = Swap(d[j],d[j-1]) if d[j-1] > d[j]
	}
}

d.length.times { |i|
	print " " unless i == 0
	print "#{d[i]}"
}
print "\n#{$swap}\n"

Measured memory_bytes: 8684
#include<bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define ll long long
#define endl "\n"
#define vi vector<int>
#define vl vector<ll>
#define all(v) (v).begin(),(v).end()
#define mst(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mt make_tuple
#define eb emplace_back
using namespace std;
const int N=2e5+5,mod=998244353;
const ll inf=3e18;
void solve(){
    string s,t;
    cin>>s>>t;
    bool f=1;
    for(int i=0;i<s.length();i++)
    if(s[i]!=t[i]){
        f=0;
        break;
    }
    if(f==1) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

int main(){
    #ifdef ONLINE_JUDGE
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	#endif
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll t,p;
    t=1;
    //cin>>t;
    for(p=1;p<=t;p++){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3652
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define pai 3.1415926535

int main(void) {
	int X, Y;
	scanf("%d%d", &X, &Y);
	int sum = 0;
	if (X == 3) {
		sum += 100000;
	}
	else if (X == 2) {
		sum += 200000;
	}
	else if (X == 1) {
		sum += 300000;
	}

	if (Y == 3) {
		sum += 100000;
	}
	else if (Y == 2) {
		sum += 200000;
	}
	else if (Y == 1) {
		sum += 300000;
	}

	if (X == 1 && Y == 1) {
		sum += 400000;
	}
	printf("%d", sum);
	return 0;
}




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

using namespace std;
#define ll  long long
#define ld  long double
#define endl '\n'
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const ll mod = 1000000007;
const double PI = 3.141592653589793238463;
const int MAXN = 1e5 + 5;

ll fastPow(ll x, ll b) {
    if (b == 0)
        return 1;
    else if (!(b & 1)) {
        return fastPow(x * x, b / 2);
    } else
        return x * fastPow(x * x, (b - 1) / 2);
}

//__builtin_popcount ();
int main() {
    FAST
int a,b,c;
    cin>>a>>b>>c;
    if(a+b==c || a+c==b ||c+b==a )
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;


    return 0;
}

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

vector<pair<int, int>> field;

bool compare(pair<int, int> a, pair<int, int> b) {
  return a.second < b.second;
}

int main() {
  int n, m;
  cin >> n >> m;
  field.resize(m);

  for (int i = 0; i < m; i++) cin >> field[i].first >> field[i].second;

  sort(field.begin(), field.end(), compare);
  int ans = 0, tmp = 0;

  for (int i = 0; i < m; i++) {
    if (tmp <= field[i].first) {
      tmp = field[i].second;
      ans++;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#define INF 999999
using namespace std;
int main(){
    char N,NN;
    while(scanf("%c",&N)){
        if(N==10)break;
        if(N=='1');
        if(N=='2')cout<<"k";
        if(N=='3')cout<<"s";
        if(N=='4')cout<<"t";
        if(N=='5')cout<<"n";
        if(N=='6')cout<<"h";
        if(N=='7')cout<<"m";
        if(N=='8')cout<<"y";
        if(N=='9')cout<<"r";
        if(N=='0'){
            scanf("%c",&NN);
            if(NN=='T')cout<<"wa";
            if(NN=='D')cout<<"wo";
            if(NN=='U')cout<<"nn";
            continue;
        }
        scanf("%c",&N);
        if(N=='T')cout<<"a";
        if(N=='L')cout<<"i";
        if(N=='U')cout<<"u";
        if(N=='R')cout<<"e";
        if(N=='D')cout<<"o";
    }
    puts("");
    return 0;
}

Measured memory_bytes: 1116
N = int(input())
A = list(map(lambda x:2*int(x),input().split()))

x1 = 0
for i in range(N):
    if i%2 == 0:
        x1 += A[i]
    else:
        x1 -= A[i]
    
x1 = x1//2

ans = [x1]

for i in range(N-1):
    ans.append(A[i]-ans[-1])

print(' '.join(map(str,ans)))


Measured memory_bytes: 19144
n, m = map(int, input().split())

lac = set()
lwa = [0] * n
ac = 0
wa = 0

for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if p in lac:
        continue
    if s == 'AC':
        lac.add(p)
        ac += 1
        wa += lwa[p]
    if s == 'WA':
        lwa[p] += 1

print(ac, wa)

Measured memory_bytes: 12652
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define rep0(i,n) rep(i,0,n)
#define rep1(i,n) rep(i,1,n+1)
#define repR(i,s,n) for(ll i = (n-1); i >= (s); i--)
#define repR0(i,n) repR(i,0,n)
#define repR1(i,n) repR(i,1,n+1)

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;
#define fcout cout << fixed << setprecision(18)

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

int a[100];
int cells[100][100]; // r * c

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

  ll ans = 0;
  rep0(i, N) {
    ll temp;
    cin >> temp;
    if (temp >= K) ans++;
  }

  cout << ans << BR;
  return 0;
}

Measured memory_bytes: 256
# AOJ 0538: IOIOI
# Python3 2018.7.1 bal4u

import sys
from sys import stdin
input = stdin.readline

while True:
	n = int(input())
	if n == 0: break
	m = int(input())
	s = input().strip()
	ans = cnt = i = 0
	while i < m:
		if i+1 < m and s[i:i+2] == 'IO':
			cnt += 1
			i += 1
		elif cnt > 0:
			if s[i] == 'O': cnt -= 1
			if cnt >= n: ans += cnt-n+1
			cnt = 0
		i += 1
	print(ans)



Measured memory_bytes: 7308
#include <iostream>
#include <vector>
#include <cmath>
 
using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    
    int N;
    long long K;
    cin >> N >> K;
    vector<int> A(N, 0);
    for(int i=0; i<N; i++){
        cin >> A[i];
    }
    
    int now=1;
    vector<long long> ord(N+1, -1);
    vector<int> position;
    
    while(ord[now] == -1){
        ord[now] = position.size();
        position.push_back(now);
        now = A[now-1];
    }
    
    long long cycle = position.size() - ord[now];
    long long b = ord[now];
    
    if(K <= b) cout << position[K] << endl;
    else {
        K = K - b;
        K = K % cycle;
        cout << position[b+K] << endl;
    }
    
    return 0;
}


Measured memory_bytes: 6632
class Multiset:
    def __init__(self, N):
        self.N = N
        self.tree = [0] * (N + 1)
        self.bisect_K = [1 << k for k in reversed(range(N.bit_length()))]

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.tree[i]
            i -= i & -i
        return s

    def bisect(self, w):
        if w <= 0:
            return 0
        bit, N = self.tree, self.N
        i = 0
        for k in self.bisect_K:
            ni = i + k
            if ni <= N and bit[ni] < w:
                w -= bit[ni]
                i = ni
        return i + 1

    def insert(self, i):
        while i <= self.N:
            self.tree[i] += 1
            i += i & -i

    def erase(self, i):
        while i <= self.N:
            self.tree[i] -= 1
            i += i & -i

    def lower_bound(self, x):
        return self.bisect(self.sum(x))

    def size(self):
        return self.sum(self.N)


def main():

    # https://atcoder.jp/contests/abc134/tasks/abc134_e

    N, *A = map(int, open(0).read().split())

    memo = {a: i for i, a in enumerate(sorted(set(A)), 1)}
    M = len(memo)

    ms = Multiset(M)
    for b in (memo[a] for a in A):
        i = ms.lower_bound(b - 1)
        if i != 0:
            ms.erase(i)
        ms.insert(b)

    print(ms.size())


if __name__ == '__main__':
    main()


Measured memory_bytes: 23316
"""
    This template is made by Satwik_Tiwari.
    python programmers can use this template :)) .
"""

#===============================================================================================
#importing some useful libraries.

import sys
import bisect
import heapq
from math import *
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl #
from bisect import bisect_right as br
from bisect import bisect

#===============================================================================================
#some shortcuts

mod = pow(10, 9) + 7
def inp(): return sys.stdin.readline().strip() #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)


#===============================================================================================
# code here ;))

def solve():
    k = int(inp())
    a,b = sep()
    if (b//k) - (a//k) > 0:
        print('OK')
    else:
        if(k == 1):
            print('OK')
        else:
            if(a%k == 0 or b%k==0):
                print('OK')
            else:
                print('NG')



testcase(1)



Measured memory_bytes: 67948
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <string.h>
#include <stack>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
typedef long long ll;
typedef pair<int,int> P;

int main() {
    string s;
    cin >> s;
    ll ans = 0;
    rep(i, 0, s.size()){
        if(s[i] == 'W' && s[i+1] == 'B')ans++;
    }
    reverse(s.begin(), s.end());
    rep(i, 0, s.size()){
        if(s[i] == 'W' && s[i+1] == 'B')ans++;
    }
    cout << ans << endl;
   return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H, W;
    string S;
    cin >> H >> W;
    int a, b;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> S;
            if (S == "snuke") {
                a = j, b = i;
            }
        }
    }
    cout << char(a + 'A') << b + 1 << endl;
    return 0;
}

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

int main() {
	
	ll n, x, m; cin >> n >> x >> m;
	vector<ll> visit(m, -1);
	vector<ll> a;
	ll higePlusCycleLength = 0;
	ll higePlusCycleSum = 0;
	while (visit[x] == -1) {
		a.push_back(x);
		visit[x] = higePlusCycleLength;
		higePlusCycleLength++;
		higePlusCycleSum += x;
		x = x * x % m;
	}
	ll cycle = higePlusCycleLength - visit[x];
	ll cycleSum = 0;
	for (int i = visit[x]; i < higePlusCycleLength; i++) {
		cycleSum += a[i];
	}
	ll ans = 0;
	if (n <= higePlusCycleLength) {
		for (int i = 0; i < n; i++) {
			ans += a[i];
		}
	}
	else {
		n -= higePlusCycleLength;
		ans += higePlusCycleSum;
		ans += cycleSum * (n / cycle);
		n %= cycle;
		for (int i = visit[x]; i < visit[x] + n; i++) {
			ans += a[i];
		}
	}
	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4592
N = int(input())

x = list(map(int, input().split()))

x.sort()

s = 0
t = 0
for i in range(N):
    s += (x[i]-100)**2
    t += (x[i]-1)**2

s = max(s,t)

for i in range(1,100):
    a = 0
    for j in range(N):
        a += (x[j]- i)**2
    s = min(s, a)
    
print(s)


Measured memory_bytes: 3064
S = input()
n = len(S)
flag = True
for i in range(n):
  if i %2 == 0 and S[i] == 'L':
    flag = False
  elif i%2 != 0 and S[i] == 'R':
    flag = False
if flag == True:
  print('Yes')
else:
  print('No')

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

int main(){
  string s;
  std::cin >> s;
  string hoge = "CODEFESTIVAL2016";
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if(s[i] != hoge[i])cnt++;
  }
  std::cout << cnt << std::endl;    
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<iomanip>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a;i < b; i++)

int main() {

	int a, b;
	cin >> a >> b;

	int ans = a + b;
	if (ans < a - b) ans = a - b;
	if (ans < a * b) ans = a * b;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
queue<int> ver;
queue<int> hor;
bool vis[100000][10000];
int dx[]={1,-1,0,0};
int dy[]={0,0,-1,1};
int main(){
	string s[55];
	int row,col;
	scanf("%d%d",&row,&col);
	int ban=0;
	for(int i=0;i<row;i++){
		cin>>s[i];
		int leng=s[i].size();
		for(int j=0;j<leng;j++){
			if(s[i][j]=='.')ban++;
		}
	}
	ver.push(0);
	hor.push(0);
	int step=0;
	bool flag=false;
	while(!ver.empty()){
		int sz=ver.size();
		for(int i=0;i<sz;i++){
			int I=ver.front(),J=hor.front();
			if(I==row-1 && J==col-1){
				flag=true;
				break;
			}
			for(int j=0;j<4;j++){
				int x=I+dx[j];
				int y=J+dy[j];
				if(x>=0 && y>=0 && x<row && y<col){
					if(!vis[x][y]){
						vis[x][y]=1;
						if(s[x][y]=='.'){
							ver.push(x);
							hor.push(y);	
						}
					}
				}
			}
			ver.pop();
			hor.pop();
		}
		if(flag==true)break;
		step++;
	}
	if(flag==true)printf("%d\n",ban-step-1);
	else printf("-1\n");
}

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

#define INF (1<<30)

int main(){
	int n;	cin>>n;
	int pMIN;	cin>>pMIN;

	int ans=1;
	for(int i=1;i<n;i++){
		int x;	cin>>x;
		if(pMIN>=x){
			ans++;
			pMIN=x;
		}
	}
	cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

func main() {
	var num int
	fmt.Scan(&num)
	fmt.Printf("%d:", num)
	res := factorize(num)
	for i := 0; i < len(res); i++ {
		fmt.Printf(" %d", res[i])
	}
	fmt.Println()
}

func factorize(num int) []int {
	nextprime := primegen()
	res := make([]int, 1)
	if isPrime(num) {
		res[0] = num
		return res
	}
	for i := nextprime(); i <= num; i = nextprime() {
		if num%i == 0 {
			res[0] = i
			res = append(res, factorize(num/i)...)
			return res
		}
	}
	return nil
}

func isPrime(num int) bool {
	if num < 2 {
		return false
	}
	if num == 2 {
		return true
	}
	if num%2 == 0 {
		return false
	}
	sqrt := int(math.Sqrt(float64(num)))
	for i := 3; i <= sqrt; i++ {
		if num%i == 0 {
			return false
		}
	}
	return true
}

func primegen() func() int {
	i := 0
	return func() int {
		i++
		for !isPrime(i) {
			i++
		}
		return i
	}
}



Measured memory_bytes: 1132
using System;
using System.IO;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Numerics;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using Debug = System.Diagnostics.Debug;
using LayoutKind = System.Runtime.InteropServices.LayoutKind;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;


static class P
{
    static void Main()
    {
        var nx = Console.ReadLine().Split().Select(int.Parse).ToArray();
        long X = nx[1];
        //ちゅーごくじょーよてーり
        //オーダーによってSの終端が決定する
        //まず影響するのは降順のみなことは自明に分かって、
        //で、「次」を選ぶことができる順番は
        //「確率」「期待値」
        //aを取り除いた場合、その後に適用できるのはそれ以前全て。

        List<int> s = Console.ReadLine().Split().Select(int.Parse).OrderByDescending(x => x).ToList();
        ModInt[] dp = new ModInt[X + 1];
        dp[X] = 1;
        ModInt remain = s.Count - 1;
        foreach (var mod in s)
        {
            ModInt[] newDP = new ModInt[X + 1];

            for (int i = 0; i < dp.Length; i++)
            {
                newDP[i % mod] += dp[i];
                newDP[i] += dp[i] * remain;
            }
            remain--;
            dp = newDP;
        }
        ModInt res = 0;
        for (int i = 0; i < dp.Length; i++)
        {
            res += dp[i] * i;
        }
        Console.WriteLine(res);
    }
}

struct ModInt
{
    const int MOD = 1000000007;
    long Data;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public ModInt(long data) { if ((Data = data % MOD) < 0) Data += MOD; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator long(ModInt modInt) => modInt.Data;
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static implicit operator ModInt(long val) => new ModInt(val);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator +(ModInt a, ModInt b)
    {
        long res = a.Data + b.Data;
        return new ModInt() { Data = res >= MOD ? res - MOD : res };
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator +(ModInt a, long b) => new ModInt(a.Data + b);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator -(ModInt a, ModInt b)
    {
        long res = a.Data - b.Data;
        return new ModInt() { Data = res < 0 ? res + MOD : res };
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator -(ModInt a, long b) => new ModInt(a.Data - b);
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static ModInt operator /(ModInt a, ModInt b) => a * Power(b, MOD - 2);

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    static ModInt Power(ModInt n, long m)
    {
        ModInt res = 1;
        while (m > 0)
        {
            if ((m & 1) == 1) res *= n;
            n *= n;
            m >>= 1;
        }
        return res;
    }
}


Measured memory_bytes: 31096