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

int main() {
    int64_t N,M;
    cin >> N >> M;
    bool A = false;
    vector<vector<int> > data(M,vector<int>(2));
    string ans = "";
    string aa = "";
    for (int i = 0;i < N;i++) { ans += "0"; }
    for (int i = 0;i < N;i++) { aa += "1"; }


    int a,b;
    for (int i = 0;i < M;i++) {
        cin >> a >> b;
        data[i][0] = a;
        data[i][1] = b;
        ans[a - 1] = to_string(b)[0];
        if (b == 0) {
            aa[a - 1] = '0';
        }
        for (int d = 0;d < (i + 1);d++) {
            if (data[d][0] == a && data[d][1] != b) {
                A = true;
            }
        }
    }

    if (ans[0] == '0' && aa[0] == '1' && ans.size() != 1) {ans[0] = '1';}

    if ((ans[0] == '0' && ans.size() != 1) || A) {
        cout << "-1" << endl;
    } else {
        cout << ans << endl;
    }
}


Measured memory_bytes: 256
r1,c1,r2,c2=map(int,input().split())

mod = 10**9+7
MAX_N = 3*10**6

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod

def comb(n,k,mod):
    if n<k:return 0
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod

ans=comb(c1+r1,r1,mod)-comb(c1+r2+1,r2+1,mod)-comb(c2+r1+1,r1,mod)+comb(c2+r2+2,r2+1,mod)
ans%=mod

print(ans)

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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define pb push_back
#define mp make_pair
#define INF 999999999
#define MOD 1000000007
#define sp ' '
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()

//typedef
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<long, long> pll;
typedef map<int, int> mint;
typedef set<int> sint;
typedef vector<int> vint;
typedef vector<char> vchr;
typedef vector<long long> vll;
typedef vector<string> vstr;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll a, ll b, ll c){ll ans=1; rep(i, b){ans=ans*a%c;} return ans;}


template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T>
void dpp(T n){cerr << n << endl;}
template<typename T>
void vpp(T a){rep(i,a.size()){cout << a[i] << endl;}}
template<typename T>
void vdp(T a){rep(i,a.size()){cerr << a[i] << endl;}}

const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ddx[8] = {1,0,-1,0,1,-1,-1,1};
const int ddy[8] = {0,1,0,-1,1,1,-1,-1};




template < typename T > std::string to_string( const T& n )
{
    std::ostringstream stm ;
    stm << n ;
    return stm.str() ;
}


vector<string> split(const string &str, char sep)
{
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.pb(buffer);
    }
    return v;
}




int main(){

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

    int h, w;
    cin >> h >> w;

    char a[h][w];
    rep(i, h){
        rep(j, w){
            cin >> a[i][j];
        }
    }

    set<int> gyou;
    set<int> retu;
    rep(i, h){
        rep(j, w){
            if(a[i][j] == '#'){
                gyou.insert(i);
                retu.insert(j);
            }
        }
    }

    rep(i, h){
        bool ok = false;
        auto it = gyou.find(i);
        if(it == gyou.end()) continue;
        rep(j, w){
            if(retu.find(j) != retu.end()){
                cout << a[i][j];
                ok = true;
            }
        }

            cout << endl;
    }



    return 0;
}


Measured memory_bytes: 256
from collections import deque

class Task:
    def __init__(self, name, cost):
        self.name = name
        self.cost = cost

class RoundRobin:
    def __init__(self):
        self.time = 0
        self.queue = deque()
        self.num_of_task, self.quantum = map(int, input().split())
        
    def enqueue(self, task):
        self.queue.append(task)
    
    def dequeue(self):
        return self.queue.popleft()


rr = RoundRobin()

for _ in range(rr.num_of_task):
    input_task = input().split()
    rr.enqueue(Task(input_task[0], int(input_task[1])))

while len(rr.queue) > 0:
    task = rr.dequeue()
    if task.cost <= rr.quantum:
        rr.time += task.cost
        print("%s %d"%(task.name, rr.time))
    else:
        task.cost -= rr.quantum
        rr.time += rr.quantum
        rr.enqueue(task)



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

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

vector<pair<ll,int>> factorize(ll n) {
    vector<pair<ll,int>> res;
    for(ll i = 2;i*i<=n;i++) {
        if(n%i != 0) continue;
        res.push_back(make_pair(i,0));
        while(n%i == 0) {
            res.back().second++;
            n /= i;
        }
    }
    if(n != 1) res.push_back(make_pair(n,1));
    return res;
}

int main() {
   ll a,b;
   cin >> a >> b;
   ll g = gcd(a,b);
   auto f = factorize(g);
   ll ans = f.size()+1;
   cout << ans << endl;
}

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

using namespace std;

int main()
{
    string S;
    cin >> S;
    int len = S.length();
    int lenOne = len - 2;
    int lenTwo = len - 1;
    int flag = 0;

    if (S[0] != 'A')
    {
        cout << "WA" << endl;
        return 0;
    }
    else
    {
        for (int i = 2; i <= lenOne; i++)
        {
            if (S[i] == 'C')
                flag += 1;
            if (flag == 2)
                break;
        }

        if (flag != 1)
        {
            cout << "WA" << endl;
            return 0;
        }

        int cnt = 0;
        for (int i = 0; i <= lenTwo; i++)
        {
            if (islower(S[i]) != 0)
                cnt++;
        }
        if (cnt != len - 2)
        {
            cout << "WA" << endl;
            return 0;
        }
    }

    cout << "AC" << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
  public static void main(String[] args) {
	  solveC();
	  
  }
  
  private static void solveC() {
	  FastReader sc = new FastReader();
	  String s = sc.next();
	  long[] res = new long[2];
	  helper(s, 1, s.substring(0, 1) , res);
	  System.out.println(res[0]);
  }
  
  private static void helper(String s, int pos, String currTmp, long[] res) {
	  if (pos == s.length()) {
		  // System.out.println(currTmp);
		  res[0] += computeFormula(currTmp);
	  } else {
		  if (pos < s.length()) {
			  helper(s, pos + 1, currTmp + s.charAt(pos), res);
			  helper(s, pos + 1, currTmp + "+" + s.charAt(pos), res);
		  }
	  }
  }

  private static long computeFormula(String s) {
	  long res = 0;
	  long num = 0;
	  for (int i = 0; i < s.length(); i++) {
		  char c = s.charAt(i);
		  
		  if (c == '+') {
			  res += num;
			  num = 0;
		  } else {
			  num *= 10;
			  num += c - '0';
			  if (i == s.length() - 1) {
				  res += num;
				  num = 0;
			  }
		  }
	  }

	  return res;
  }
  
  static class FastReader {
    BufferedReader br;
    StringTokenizer st;

    public FastReader() {
      br = new BufferedReader(new InputStreamReader(System.in));
    }
  
    String next() { 
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException  e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    double nextDouble() { 
      return Double.parseDouble(next());
    }

    String nextLine() {
      String str = "";
        try{
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
      }
  }
}


Measured memory_bytes: 21588
#include<stdio.h>

int main()
{
    int n,i,j,s[110]={0},kari=1,ans=0,sub=0,same[110]={0};
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&(s[i]));
        if(i==0)continue;
        if(s[i]==s[i-1])kari++;
        else
        {
            same[sub]=kari;
            kari=1;
            sub++;
        }
    }
    same[sub]=kari;
    sub++;
    for(j=0;j<sub;j++)
    {
        ans+=(same[j]/2);
    }
    printf("%d",ans);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
 
using namespace std;
 
#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()
 
int GCD(int a,int b){ return b ? GCD(b,a%b) : a ;}
int LCM(int a,int b){ return a*b / GCD(a,b) ;}
 
typedef long long ll;
typedef unsigned long long ull;
 
const int INF = 1e9;

int main(){
      int r,d,x;
      cin >> r >> d >> x;
      int pre = x;
      for(int i=0;i<10;i++){
            cout << r*pre - d << endl;
            pre = r*pre-d;
      }
      return 0;
}


Measured memory_bytes: 256
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''

def myAnswer(N:int,M:int,X:list,Y:list) -> int:
   ans = {0}
   box = [1] * N
   for x,y in zip(X,Y):
      if(x-1 in ans):
         if(box[x - 1]==1):
            ans.remove(x-1)
         ans.add(y-1)
      box[x-1] -= 1
      box[y-1] += 1
   return len(ans)

def modelAnswer():
   return
def main():
   N,M = map(int,input().split())
   X = []
   Y = []
   for _ in range(M):
      x,y=map(int,input().split())
      X.append(x)
      Y.append(y)
   print(myAnswer(N,M,X,Y))
if __name__ == '__main__':
   main()

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

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <= b; i++)

#define lli long long
#define li long
#define vi vector<int>
#define vli vector<li>
#define vlli vector<lli>
#define pi pair<int,int>
#define pli pair<li, li>
#define vpi vector<pi>

using namespace std;

int main() {

    ios_base::sync_with_stdio(false);

    int n, i;

    cin >> n;

    int nums[n];
    REP(i, 0, n-1) cin >> nums[i];


    int ans = 1;
    int ans_diff = 10000;
        
    int sum1 = 0;

    for(i = 0; i < n -1; i++) {
        sum1 += nums[i];

        int sum2 = 0;

        for(int j = i+1; j < n; j++) {
            sum2 += nums[j];
        }

        if(abs(sum1 - sum2) < ans_diff) ans_diff = abs(sum1 - sum2);
    }
    

    cout << ans_diff << endl;

}


Measured memory_bytes: 256
def avg(px)
  (1 + px) / 2r
end

_, k = gets.split.map(&:to_i)

dices = gets.split.map(&:to_i)

pxa = dices.map{|px| avg(px) }

sol = 0

h = {
  tail: 0,
  body: Array.new(k){ 0 },
  val: 0
}

pxa.each do |px|
  h[:tail] = h[:body].shift
  h[:body] << px
  h[:val] = h[:val] - h[:tail] + px
  sol = h[:val] if sol < h[:val]
end

puts sol.to_f

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

#define rep(i,x,y) for(int i=(x);i<(y);++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf=1e9;
const int64_t inf64=1e18;
const double eps=1e-9;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec){
    os << "[";
    for (const auto &v : vec) {
    	os << v << ",";
    }
    os << "]";
    return os;
}

template<class graph_type,class T> std::vector<T> spfa(const graph_type &graph,const int start){
    std::vector<T> dist(graph.size(),std::numeric_limits<T>::max());
    std::deque<int> dq;
    std::vector<bool> in_dq(graph.size(),false);
    dist[start]=0;
    dq.push_back(start);
    in_dq[start]=true;

    int64_t denom=1,numer=0;
    auto small_label_first=[&](){
        const int u=dq.front(),v=dq.back();
        if(dist[u]>dist[v]){
            dq.pop_back();
            dq.push_front(v);
        }
    };
    auto large_label_last=[&](){
        while(dist[dq.front()]*denom>numer){
            dq.push_back(dq.front());
            dq.pop_front();
        }
    };
    while(!dq.empty()){
        const int u=dq.front();
        dq.pop_front();
        in_dq[u]=false;
        --denom;
        numer-=dist[u];
        for(const auto &edge:graph[u]){
            const int v=edge.first;
            if(dist[v]>dist[u]+edge.second){
                dist[v]=dist[u]+edge.second;
                if(!in_dq[v]){
                    dq.push_back(v);
                    in_dq[v]=true;
                    ++denom;
                    numer+=dist[v];
                    small_label_first();
                    //large_label_last();
                }
            }
        }
    }
    return dist;
}

void solve(){
    int v,e,r;
    cin >> v >> e >> r;
    vector<vector<pair<int,int>>> graph(v);
    rep(i,0,e){
        int s,t,d;
        cin >> s >> t >> d;
        graph[s].push_back(make_pair(t,d));
    }
    vector<int> dist=spfa<vector<vector<pair<int,int>>>,int>(graph,r);
    rep(i,0,v){
        if(dist[i]==std::numeric_limits<int>::max()) cout << "INF" << endl;
        else cout << dist[i] << endl;
    }
}

int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    solve();
    return 0;
}

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

int main() {
    while(1) {
        int H, W;
        cin >> H >> W;
        if (H == 0 && W == 0) {
            break;
        }
        for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
                cout << '#';
            }
            cout << '\n';
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

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

  sort(a.begin(), a.end());
  cout << a[0] + a[1] << endl;


  
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };
	static final int INF = Integer.MAX_VALUE / 3;
	static final long LINF = Long.MAX_VALUE / 3;

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		String s = fs.next();
		char c[] = s.toCharArray();
		int r = 0;
		String now = "";
		int ans = 0;
		for(int l=0;l<n;l++) {
			if(now.length()>0)now = now.substring(1);
			while(l>r)r++;
			while(s.indexOf(now + c[r], r+1)>=0) {
				now += c[r];
				ans = Math.max(ans, r - l + 1);
				r++;
			}
		}
		System.out.println(ans);
	}

	//MOD culculations
	static long plus(long x, long y) {
		long res = (x + y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long sub(long x, long y) {
		long res = (x - y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long mul(long x, long y) {
		long res = (x * y) % mod;
		return res < 0 ? res + mod : res;
	}

	static long div(long x, long y) {
		long res = x * pow(y, mod - 2) % mod;
		return res < 0 ? res + mod : res;
	}

	static long pow(long x, long y) {
		if (y < 0)
			return 0;
		if (y == 0)
			return 1;
		if (y % 2 == 1)
			return (x * pow(x, y - 1)) % mod;
		long root = pow(x, y / 2);
		return root * root % mod;
	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}

Measured memory_bytes: 86356
#include <bits/stdc++.h>
#define ll long long int
#define mod_ceil(a, b) (a % b) ? a / b + 1 : a / b
using namespace std;

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

    ll n, m, a, b, ans = 0;
    cin >> n >> m;
    vector<ll> G[n];
    pair<ll, ll> E[m];
    vector<bool> B(m, false);
    for (ll i = 0; i < m; i++)
    {
        cin >> a >> b;
        G[a - 1].push_back(b - 1);
        G[b - 1].push_back(a - 1);
        E[i] = {a - 1, b - 1};
    }
    for (ll i = 0; i < m; i++)
    {
        ll l = E[i].first, r = E[i].second;
        for (auto it = G[l].begin(); it != G[l].end(); it++)
        {
            if (*it == r)
            {
                G[l].erase(it);
                break;
            }
        }
        for (auto it = G[r].begin(); it != G[r].end(); it++)
        {
            if (*it == l)
            {
                G[r].erase(it);
                break;
            }
        }
        vector<bool> vis(n, false);
        queue<ll> Q;
        Q.push(l);
        while (!Q.empty())
        {
            ll top = Q.front();
            Q.pop();
            if (vis[top])
                continue;
            vis[top] = true;
            for (ll j = 0; j < G[top].size(); j++)
            {
                if (!vis[G[top][j]])
                {
                    Q.push(G[top][j]);
                }
                if (G[top][j] == r)
                {
                    B[i] = true;
                }
            }
        }
        G[l].push_back(r);
        G[r].push_back(l);
    }
    cout << count(B.begin(), B.end(), false) << endl;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N,K; cin>>N>>K;
  string S; cin>>S;
  int sum=0;
  rep(i,1,N-1){
    if(S[i]=='R'){
      if(S[i+1]=='L')
        sum++;
      }
    else{
      if(S[i-1]=='R')
        sum++;
      }
    }
  if(S[0]=='L')
    sum++;
  else{
    if(S[1]=='L')
      sum++;
  }
  if(S[N-1]=='R')
    sum++;
  else{
    if(S[N-2]=='R')
      sum++;
  }
  int ans=max(sum-K*2,1ll);
  cout<<N-ans<<endl;
  }


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

using namespace std;

int main()
{
    int n,x,i,l[150],sum=0,num=1;
    cin>>n>>x;
    for(i=0; i<n; i++)
        cin>>l[i];
    for(i=0; i<n; i++)
    {
        sum+=l[i];
        if(sum<=x)
            num++;
    }
    cout<<num<<endl;
    return 0;
}


Measured memory_bytes: 256
#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()
using P=pair<int,int>;
using lint=long long;
using ll=long long;
const lint inf=1e18+7;
const int MOD=1000000007;
signed main(){
  int x,n;cin>>x>>n;
  vector<int> num(1000,1);
  rep(i,n){
    int p;cin>>p;
    num[p]=0;
  }
  int mn=inf;int res=0;
  rep(i,1000){
    if(num[i]==0)continue;
    if(mn>abs(x-i)){
      mn=abs(x-i);
      res=i;
    }
  }
  cout<<res<<"\n";
  return 0;
}


Measured memory_bytes: 3632
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();

            HashSet<Integer> hs = new HashSet<>();

            for (int i = 0; i < n; ++i) {
                int x = in.nextInt();

                if (hs.contains(x))
                    hs.remove(x);
                else
                    hs.add(x);
            }

            out.println(hs.size());
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 44980
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=(1LL<<45);
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;


int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, x, a, b, sum = 0;
    cin >> n;
    for(int i=0;i<n;i++){
        if(i == 0) cin >> a; 
        else if(i == 1) cin >> b;
        else {
        	cin >> x;
        	sum ^= x;
        }
    }
    ll num = a + b - sum;
    if(num < 0LL || (num & 1)){
    	cout << -1 << endl;
    	return 0;
    }
    num /= 2LL;
    vector<ll> c(45, -1LL);
    for(int i=0;i<45;i++) if((sum >> i & 1) == 0){
    	if(num >> i & 1) c[i] = 1;
    	else c[i] = 0;
    }
    ll ans = 0;
    for(int i=0;i<45;i++) if(c[i] == 1LL) ans += 1LL << i;
    for(int i=44;i>=0;i--) if(c[i] == -1LL){
        if(ans + (1LL << i) <= a) ans += 1LL << i;
    }
    num = b + a - ans;

    if(ans == 0LL || ans > a || (num ^ ans) != sum) cout << -1 << endl;
    else cout << a - ans << endl;
    return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X)
#define debug(x0123456789) cerr<<#x0123456789<<':'<<x0123456789<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto x0123456789:v)cerr<<x0123456789<<' ';cerr<<endl;
#define INF 1000000007
#define LINF 1000000000000000007
#define EPS 1e-9
typedef long long ll;
typedef long double ld;

long long POW(long long x,long long n){long long ans = 1;while(n){if(n%2)ans *= x;x *= x;n >>= 1;}return ans;}
long long POW(long long x,long long n,long long mod){long long ans = 1;while(n){if(n%2)ans *= x;x *= x;x %= mod;ans %= mod;n >>= 1;}return ans;}

ll N;

bool check(ll n){
    if(n > N)return 0;
    map<int,int> m;
    while(n){
        m[n%10]++;
        n /= 10;
    }
    return m[3]*m[5]*m[7];
}

ll func(ll n,ll sitigosan){
    return n*10+sitigosan;
}

signed main(){
    cin >> N;
    vector<ll> v{3,5,7};
    FOR(i,0,8){
        REP(i,0,v.size()){
            v.pb(func(v[i],3));
            v.pb(func(v[i],5));
            v.pb(func(v[i],7));
        }
    }
    map<ll,bool> m;
    ll ans = 0;
    for(auto x:v)if(check(x)&&!m[x])ans++,m[x]=1;
    cout << ans << endl;
}

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

int main(){
	long n,ans;
	cin >> n;
	ans=0;
	for(int i=0;i<=n;i++){
		if(i%15==0){
			continue;	
		}else if(i%3==0){
			continue;
		}else if(i%5==0){
			continue;	
		}else{
			ans+=i;
		}
	}

	cout << ans;
	return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {


        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int a = Integer.parseInt(sc.next());

        if (x < a) {
            System.out.println(0);
        } else {
            System.out.println(10);
        }
    }
}


Measured memory_bytes: 23636
while True:
    n,x = (int(i) for i in input().split())
    if n == 0 and x == 0:
        break
    
    c = 0
    for i in range(1, n + 1):
        for j in range(1,i):
            for k in range(1,j):
                if i + j + k == x:
                    c += 1
                    
    print(c)


Measured memory_bytes: 5600
#include <bits/stdc++.h>
#define mem(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
#define ll long long
#define pb push_back
#define PII pair<int,int>
#define X first
#define Y second
#define MP make_pair
#define PI acos(-1.0)
#define eps 1e-8
const int maxn=2e5+10;
const int mod=1e9+7;
using namespace std;

int n,x,y;
int ans[2005];

int main()
{
    scanf("%d%d%d",&n,&x,&y);
    for(int i=1;i<n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            ans[min(abs(i-x)+abs(j-y)+1,min(abs(i-x)+abs(j-x),min(abs(i-y)+abs(j-y),abs(i-j))))]++;
        }
    }
    for(int i=1;i<=n-1;i++)
        printf("%d%c",ans[i]," \n"[i==n-1]);
    // system("pause");
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<tuple>
#include<vector>
#include<algorithm>
#include<iterator>
#include<cmath>
#include<functional>
using namespace std;

int main(){
    int N, M;
    const int INF = 1000000;
    cin >> N >> M;
    vector< tuple<int, int, int> > l(M);
    vector< vector<int> > w(N, vector<int>(N));
    for(int i=0; i<N; i++){
        for(int j=0; j<N; j++){
            w.at(i).at(j) = INF;
        }
    }
    for(int i=0; i<M; i++){
        int a, b, c;
      	cin >> a >> b >> c;
        a--;
        b--;
        w.at(a).at(b) = w.at(b).at(a) = c;
        l.at(i) = make_tuple(a,b,c);
    }
    //warshall floyd
    for(int k=0; k<N; k++){
        for (int i=0; i<N; i++){
            for(int j=0; j<N; j++){
                if(w.at(i).at(j) > w.at(i).at(k) + w.at(k).at(j)){
                    w.at(i).at(j) = w.at(i).at(k) + w.at(k).at(j);
                }
            }
        }
    }
    int r = 0;
    for(auto i = l.begin(); i<l.end(); i++){
        int a, b, c;
        a = get<0>(*i);
        b = get<1>(*i);
        c = get<2>(*i);
        if(w.at(a).at(b) != c){
            r++;
        }
    }
    cout << r << endl;
}


Measured memory_bytes: 3648
#include<iostream>

using namespace std;

class dice {
public:
	int f[6];
	dice(int f1, int f2, int f3, int f4, int f5, int f6):
		f{f1, f2, f3, f4, f5, f6}{}
	void rollN() {
		int t=f[0];
		f[0]=f[1];
		f[1]=f[5];
		f[5]=f[4];
		f[4]=t;
	}
	void rollE() {
		int t=f[0];
		f[0]=f[3];
		f[3]=f[5];
		f[5]=f[2];
		f[2]=t;
	}
	void rollS() {
		int t=f[0];
		f[0]=f[4];
		f[4]=f[5];
		f[5]=f[1];
		f[1]=t;
	}
	void rollW() {
		int t=f[0];
		f[0]=f[2];
		f[2]=f[5];
		f[5]=f[3];
		f[3]=t;
	}
};

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int f1, f2, f3, f4, f5, f6;
	cin>>f1>>f2>>f3>>f4>>f5>>f6;
	dice d(f1, f2, f3, f4, f5, f6);
	char dir;
	while(cin>>dir) {
		if(dir=='N') d.rollN();
		else if(dir=='E') d.rollE();
		else if(dir=='S') d.rollS();
		else if(dir=='W') d.rollW();
	}
	cout<<d.f[0]<<'\n';
	return 0;
}



Measured memory_bytes: 3172
// educational dp - coins
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pr cout<<
#define in cin>>
#define tc(t) ll t;cin>>t;while(t--)
#define fr(i,n) for(ll i=0;i<n;i++)
#define mod 1e9+7
#define nl pr "\n"
#define rt return

int main()
{
    ll n,i,j,x;
    in n;
    double s=0,p[n],dp[n][n+2];
    fr(i,n) in p[i];
    fr(i,n) fr(j,n+2) dp[i][j]=0;
    dp[0][1]=1-p[0];
    dp[0][2]=p[0];
    
    for(i=1;i<n;i++)
        for(j=1;j<=i+2;j++)
            dp[i][j]=(dp[i-1][j-1]*p[i])+(dp[i-1][j]*(1-p[i]));
    
    x=n/2+1;
    for(ll i=x+1;i<n+2;i++){s+=dp[n-1][i];}
    pr setprecision(10);
    pr s;
    
}

Measured memory_bytes: 70528
#include<bits/stdc++.h>
#define swap mswap
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define int long long 
using namespace std;
const int big=0x7fffffffffffff;
void swap(int &x,int &y)
{
    x^=y^=x^=y;
}
void read(int &x)
{
    x=0;
    char ch=getchar();
    int pd=1;
    while(ch<'0'||ch>'9')
    {
        if(ch=='-')
        {
            pd=-pd;
        }
        ch=getchar();
    }
    while(ch<='9'&&ch>='0')
    {
        x=x*10+ch-'0';
        ch=getchar();
    }
    x*=pd;
}
void write(const int &x)
{
    char f[100001];
    int s=0;
    int tmp=x;
    if(tmp==0)
    {
        putchar('0');
        return;
    }
    if(tmp<0)
    {
        tmp=-tmp;
        putchar('-');
    }
    while(tmp>0)
    {
        f[s++]=tmp%10+'0';
        tmp/=10;
    }
    while(s>0)
    {
        putchar(f[--s]);
    }
}

const int mod=1e9+7;
const int N=2e5+10;
int jie[N],ni[N],n,A,B;
int c[N],w[N],minn[N],cnt[N];
int sum,ans=1;
int ksm(int x,int y)
{
	int ans=1;
	while(y)
	{
		if(y&1)
		{
			ans=(ans*x)%mod;
		}
		x=(x*x)%mod;
		y>>=1;
	}
	return ans%mod;
}
int zuhe(int x,int y)
{
	return ((jie[x]*ni[y])%mod*ni[x-y])%mod;
}
signed main()
{
//	freopen("keep.in","r",stdin);
//	freopen("keep.out","w",stdout);
	jie[0]=1;
	read(n);
	read(A);
	read(B);
	for(register int i=1;i<=n;++i)
	{
		read(c[i]);
		read(w[i]);
		minn[i]=big;
		cnt[c[i]]++;
		jie[i]=jie[i-1]*i%mod;
	}
	
	ni[n]=ksm(jie[n],mod-2);
	for(register int i=n-1;i>=0;--i)
	{
		ni[i]=(ni[i+1]*(i+1))%mod;
//		cout<<ni[i]<<endl;
	}
	
//	cout<<zuhe(3,1)<<"   QWQ"<<endl;
	for(register int i=1;i<=n;++i)
	{
		minn[c[i]]=min(minn[c[i]],w[i]);
	}
	int min1=0,allmin=0;
	for(register int i=1;i<=n;++i)
	{
		if(minn[i]!=big)
		{
			if(!min1||minn[i]<minn[min1])
			{
				allmin=min1;
				min1=i;
			}
			else 
			{
				if(!allmin||minn[i]<minn[allmin])
				{
					allmin=i;
				}
			}
		}
	}
	for(register int i=1;i<=n;++i)
	{
		if(minn[c[i]]!=w[i]&&w[i]+minn[c[i]]<=A)continue;
		if(c[i]==min1&&w[i]+minn[allmin]<=B)continue;
		if(c[i]!=min1&&w[i]+minn[min1]<=B)continue;
		cnt[c[i]]--;
	}
	sum=cnt[min1];
	for(register int i=1;i<=n;++i)
	{
		if(i!=min1&&minn[i]+minn[min1]<=B)
		{
			sum+=cnt[i];
//			cout<<sum<<endl;
			ans=(ans*zuhe(sum,cnt[i]))%mod;
//			cout<<ans<<endl;
		}
	}
	write(ans);
}


Measured memory_bytes: 9600
module Main
  ( main
  )
where

import           Control.Applicative
import           Control.Monad
import           Data.List
import           Data.Array
import           Data.Char

main = do
  [a, b] <- map (read :: String -> Int) . words <$> getLine
  if abs (a - b) <= 1
    then putStrLn "Brown"
    else putStrLn "Alice"


Measured memory_bytes: 508
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

s = ins()
t = ins()


def solve():
    n = len(s)
    cnt = 0
    for i in range(n):
        if s[i] != t[i]:
            cnt += 1
    return cnt


print(solve())


Measured memory_bytes: 9584
package main

import "fmt"

func solve() {
	var A, B, C, D int
	fmt.Scan(&A, &B, &C, &D)

	fmt.Println(max(min(B, D)-max(A, C), 0))
}

func main() {
	solve()
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}


Measured memory_bytes: 512
#coding: utf-8

def print_list(X):
    first_flag = True
    for val in X:
        if first_flag:
            print_line = str(val)
            first_flag = False
        else:
            print_line = print_line + ' ' + str(val)
    print(print_line)


def insertion_sort(A, n, g):
    global counter
    for i in range(g, n):
        tmp_val = A[i]
        j = i - g
        #print("tmp_val:", tmp_val, "A:", *A)
        while (j >= 0) and (A[j] > tmp_val):
            A[j+g] = A[j]
            j -= g
            counter += 1
            #print("tmp_val:", tmp_val, "A:", *A)
        A[j+g] = tmp_val

def shell_sort(A, n):
    global counter
    G = [i for i in [262913, 65921, 16577, 4193, 1073, 281, 77, 13, 4, 1] if i <= n]
    m = len(G)
    for i in range(0, m):
        insertion_sort(A, n, G[i])
    print(m)
    print(*G)
    print(counter)
    for i in range(n):
        print(A[i])


n = int(input())
A = [int(input()) for x in range(n)]
counter = 0

shell_sort(A, n)

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

int main(){
   int N;
   cin >> N;
   vector<vector<int>> A(2,vector<int>(N)),B(2,vector<int>(N));
   for (int i=0; i<2; ++i){
      for (int j=0; j<N; ++j){
         cin >> A[i][j];
      }
   }
   B[0][0] = A[0][0];
   for (int i=1; i<N; ++i){
      B[0][i] = B[0][i-1]+A[0][i];
   }
   B[1][0] = B[0][0] + A[1][0];
   for (int i=1; i<N; ++i){
      B[1][i] = max(B[0][i],B[1][i-1])+A[1][i];
   }
   cout << B[1][N-1] << endl;
   return 0;
}


Measured memory_bytes: 256
import java.util.Scanner

import scala.collection.immutable



object Main extends App {

  def read(): (immutable.IndexedSeq[String], immutable.IndexedSeq[String]) = {
    val sc: Scanner = new Scanner(System.in)
    val n = sc.nextInt
    val blueCards = (1 to n).map { _ =>
      sc.next()
    }
    val m = sc.nextInt
    val redCards = (1 to m).map { _ =>
      sc.next()
    }
    sc.close()
    (blueCards, redCards)
  }

  def solve() = {
    val (blueCards, redCards) = read()
    val blueStrAndNumMap = blueCards.groupBy(identity).mapValues(_.length)
    val redStrAndNumMap = redCards.groupBy(identity).mapValues(_.length)

    blueStrAndNumMap.keys.foldLeft(0) { case (acc, key) =>
      val diff = blueStrAndNumMap(key) - redStrAndNumMap.getOrElse(key, 0)
      Math.max(acc, diff)
    }
  }
  println(solve)

}


Measured memory_bytes: 27320
#include <cstdio>
#include <iostream>
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
using namespace std;

int main(void) {
  int a, b;
  cin >> a >> b;
  int d = b - a;
  cout << (d*(d+1)/2 - b) << endl;
  return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

n = n_in()

A = l_in()

if n <= 3:
    print(max(A))
    exit()




if n%2 == 0:
    res = sum(A[::2])
    dp = [[0,0] for _ in range(n)]
    #dp[i][k]は k回スキップして，i番目を使う確定した時の最大

    dp[0][0] = A[0]
    dp[1][1] = A[1]
    dp[2][0] = A[0]+A[2]

    for i in range(3,n):
        dp[i][0] = dp[i-2][0] + A[i]
        dp[i][1] = max(dp[i-3][0] + A[i], dp[i-2][1] + A[i])

    print(max(res, dp[n-1][1]))
    exit()

res = sum(A[::2])-A[-1]
dp = [[0,0] for _ in range(n)]
#dp[i][k]は k回スキップして，i番目を使う確定した時の最大

dp[0][0] = A[0]
dp[1][1] = A[1]
dp[2][0] = A[0]+A[2]

for i in range(3,n-1):
    dp[i][0] = dp[i-2][0] + A[i]
    dp[i][1] = max(dp[i-3][0] + A[i], dp[i-2][1] + A[i])

#print(dp)    
res = max(res, dp[n-2][1])

dp = [[0,0,0] for _ in range(n)]
#dp[i][k]は k回スキップして，i番目を使う確定した時の最大

dp[0][0] = A[0]
dp[1][1] = A[1]
dp[2][2] = A[2]
dp[2][0] = A[0]+A[2]
dp[3][1] = max(A[0],A[1])+A[3]

for i in range(4,n):
    dp[i][0] = dp[i-2][0] + A[i]
    dp[i][1] = max(dp[i-3][0] + A[i], dp[i-2][1] + A[i])
    dp[i][2] = max(
        dp[i-4][0] + A[i],
        dp[i-3][1] + A[i],
        dp[i-2][2] + A[i]
    )

#print(dp)    
print(max(res, dp[n-1][2]))


Measured memory_bytes: 132000
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
int INF = INT_MAX / 2;
double EPS = 1e-10;
 
void unko(bool x) {
	if (x) cout << "unko" << endl;
}
 
int main() {
    int N, M; cin >> N >> M;
    vector<int> K(N);
    vector<vector<int> > S(N), H(N);
	int sumK = 0;
    for (int i = 0; i < N; i++) {
        cin >> K[i];
		sumK += K[i];
        for (int k = 0; k < K[i]; k++) {
            int s, h; cin >> s >> h;
            S[i].push_back(s);
            H[i].push_back(h);
        }
    }
	unko(sumK >= 4000 * 0.6 && M >= 200 * 0);
    double maxi = 0;
    for (int t = 0; t < N; t++) {
        vector<int> dp(M + 1, -INF);
        dp[M] = 0;
        for (int i = 0; i < N - 1; i++) {
            vector<int> _dp = dp;
            for (int j = 0; j <= M; j++) {
                int h = 0, v = 0;
                for (int k = 0; k < K[i]; k++) {
                    h += H[i][k];
                    v += S[i][k] * H[i][k];
                    if (v > j) break;
                    _dp[j - v] = max(_dp[j - v], dp[j] + h);
                }
            }
            dp = _dp;
        }
        for (int j = 0; j <= M; j++) {
            double h = dp[j], v = j;
            for (int k = 0; k < K[N - 1]; k++) {
                double dh = min((double)H[N - 1][k], v / S[N - 1][k]);
                h += dh; v -= S[N - 1][k] * dh;
            }
            maxi = max(maxi, h);
        }
        rotate(K.begin(), K.begin() + 1, K.end());
        rotate(S.begin(), S.begin() + 1, S.end());
        rotate(H.begin(), H.begin() + 1, H.end());
    }
    printf("%.20f\n", maxi);
}

Measured memory_bytes: 1272
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9,MOD = 1e9+7,ohara = 1e6;
const ll LINF = 1e18;
using namespace std;

#define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrrep(i,a,b) for(ll i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl

ll n,cnt=0,a,b,c,d,cmp,cmpp,m,h[ohara],w,x,y,sum=0,t;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);
      
    cin>>n>>t>>a;
    ll flags;
    double pos,ans=10000.0;
    rep(i,n){
        cin>>h[i];
        pos=(double)(t-h[i]*0.006);
        if(ans>=(double)(abs(pos-(double)a))){
            ans=(double)(abs(pos-(double)a));
            flags=i;
        }
        //Cout(ans);
    }
    Cout(flags+1);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

int shiro[200010], kuro[200010];

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

    shiro[0] = 0;
    kuro[0] = 0;
    rep(i, N) {
        shiro[i + 1] = shiro[i];
        kuro[i + 1] = kuro[i];
        if (S[i] == '.') {
            shiro[i + 1]++;
        } else {
            kuro[i + 1]++;
        }
    }

    int ret = INT_MAX;
    rep(i, N + 1) {
        int leftKuro = kuro[i];
        int rightShiro = shiro[N] - shiro[i];
        ret = min(ret, leftKuro + rightShiro);
    }

    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 3716
use std::io::{Read, StdoutLock};
use std::io::{stdout, BufWriter, Write};
use std::collections::{HashMap, VecDeque};
use std::str::{SplitWhitespace, FromStr};
use std::fmt::Display;

struct IO<'a> {
    sw: SplitWhitespace<'a>,
    bw: BufWriter<StdoutLock<'a>>
}

impl IO<'_> {
    #[inline(always)]
    pub fn read<T: FromStr>(&mut self) -> T where <T as std::str::FromStr>::Err: std::fmt::Debug {
        self.sw.next().unwrap().parse().unwrap()
    }
    #[inline(always)]
    pub fn writeln<T: Display>(&mut self, s: T) {
        let bytes = format!("{}\n", s);
        self.bw.write(bytes.as_bytes()).unwrap();
    }
}

// AtCoder Beginner Contest 146 D - Coloring Edges on Tree
fn main() {
    /* BEGIN TEMPLATE */
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let sw = buf.split_whitespace();
    let _stdout = stdout();
    let bw = BufWriter::new(_stdout.lock());
    let mut io = IO{sw, bw};
    /* END TEMPLATE */

    let n: usize = io.read();
    let mut tree: Vec<Vec<usize>> = vec![Vec::new(); n+1];
    let mut edges: Vec<(usize, usize)> = Vec::with_capacity(n-1);
    let mut edge_colors: HashMap<(usize, usize), usize> = HashMap::new();
    (0..n-1).for_each(|_| {
        let (a, b): (usize, usize) = (io.read(), io.read());
        tree[a].push(b);
        tree[b].push(a);
        if a < b {
            edges.push((a, b));
        } else {
            edges.push((b, a));
        }
    });
    let mut colors: Vec<usize> = vec![0; n+1];
    let mut done = vec![false; n+1];
    done[1] = true;
    colors[1] = 0;
    let mut count = colors[1];
    let mut queue: VecDeque<usize> = VecDeque::new();
    queue.push_back(1);
    while !queue.is_empty() {
        let length = queue.len();
        (0..length).for_each(|_|{
            let mut color: usize = 0;
            let front = queue.pop_front().unwrap();
            tree[front].iter().for_each(|&t|{
                if !done[t] {
                    color += 1;
                    if color == colors[front] {
                        color += 1;
                    }
                    colors[t] = color;
                    if color > count {
                        count = color;
                    }
                    done[t] = true;
                    queue.push_back(t);
                    if front < t {
                        *edge_colors.entry((front, t)).or_default() = color;
                    } else {
                        *edge_colors.entry((t, front)).or_default() = color;
                    }
                }
            });
        })
    }
    io.writeln(count);
    edges.iter().for_each(|&edge| {
        io.writeln(edge_colors.entry(edge).or_default());
    })
}

Measured memory_bytes: 16616
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <limits>
using namespace std;

int main(void){
    long long N;
    scanf("%lld", &N);
    
    long long min_dist = N - 1;
    for(int i = 1 ; i <= sqrt(N); i++){
        if(N % i != 0){
            continue;
        }
        long long dist = i + (N / i) - 2;
        min_dist = min(min_dist, dist);
    }
    
    printf("%lld\n", min_dist);
}

Measured memory_bytes: 256
def main():
    n, m = map(int, input().split())
    if m != 0:
        a = [int(input()) for _ in range(m)]
        a = set(a)
    else:
        a = set()
    
    s = [0] * (n+1)
    s[0] = 1
    s[1] = 1 if 1 not in a else 0

    for i in range(2, n+1):
        if i in a:
            continue
        s[i] = (s[i-1] + s[i-2]) % 1000000007

    print(s[n])

main()

Measured memory_bytes: 13212
# -*- coding: utf-8 -*-
from math import pi,cos,sin

A,B,H,M = list(map(int, input().rstrip().split()))
#-----

degree_A = (H*60+M) * (2*pi/(12*60))
degree_B = M * (2*pi/60)

x_A = A * cos(degree_A)
y_A = A * sin(degree_A)

x_B = B * cos(degree_B)
y_B = B * sin(degree_B)

ans = ( (x_A - x_B)**2 + (y_A - y_B)**2 )**0.5
print(ans)


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;

int main() {
  llong A, V, B, W, T;
  cin >> A >> V >> B >> W >> T;

  if (abs(A - B) <= (V - W) * T) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }

  return 0;
}

Measured memory_bytes: 3596
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

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

// Self settings
// clang-format off
#define MAX_N 100000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
ll fact(ll n) { ll res = 1; for(ll i=2;i<=n;++i) res = res * i; return res;}
ll nCr(ll n, ll r) {return (fact(n)/fact(n-r)*fact(r)) ;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const int inf = 1000000;
// clang-format on

ll H, N;
ll A[MAX_N + 1];

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> H >> N;
  ll total = 0;
  int a;
  REP(i, N) {
    cin >> a;
    total += a;
  }

  if (total >= H) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 256