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

int main() {
  vector<vector<int>> c(3, vector<int>(3));
  for (int i=0; i<3; i++){
    for (int j=0; j<3; j++){
      cin >>c.at(i).at(j);
    }
  }
  string ans = "Yes";
  /*  a.at(0)+b.at(0) a.at(0)+b.at(1) a.at(0)+b.at(2)
      a.at(1)+b.at(0) a.at(1)+b.at(1) a.at(1)+b.at(2)
      a.at(2)+b.at(0) a.at(2)+b.at(1) a.at(2)+b.at(2)
  */
  for (int i=0; i<3; i++){
    if (c.at(i).at(1)-c.at(i).at(0) != c.at(0).at(1)-c.at(0).at(0)){
      ans = "No"; break;}
    if (c.at(i).at(2)-c.at(i).at(1) != c.at(0).at(2)-c.at(0).at(1)){
      ans = "No"; break;}
    if (c.at(1).at(i)-c.at(0).at(i) != c.at(1).at(0)-c.at(0).at(0)){
      ans = "No"; break;}
    if (c.at(2).at(i)-c.at(1).at(i) != c.at(2).at(0)-c.at(1).at(0)){
      ans = "No"; break;}
  }

  cout <<ans;
  cout <<endl;
}


Measured memory_bytes: 256
N,K = map(int, input().split())
R,S,P = map(int, input().split())
T=input()

Ts=[[] for _ in range(K)]
for i in range(N):
    Ts[i%K]+=T[i]

def sub(L):
    L.append(0)
    pre = 0
    s=0
    for i in range(len(L)-1):
        if pre != L[i]:
            if L[i] == "r":
                s+=P
            elif L[i] == 's':
                s+=R
            else:
                s+=S
            pre=L[i]
        else:
            if L[i+1]!='r':
                pre='r'
            elif L[i+1]!='s':
                pre='s'
            else:
                pre='p'
    return s

s=0
for t in Ts:
    s+=sub(t)
print(s)


Measured memory_bytes: 64508
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define fi first
#define se second
#define FOR(i,n) for(int i = 0;i<n;i++)
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
const ll MOD=1000000007,INF=1ll<<60;

int dx[]={0,0,1,-1};
int dy[]={-1,1,0,0};
typedef pair<pint,int>P1;
typedef vector<vint>vvint;

int gcd(int x,int y)
{
	if(x==0) return y;
	return gcd(y%x,x);
}
int lcm(int x, int y)
{
    return (x * y / gcd(x, y));
}

int N,A,B,C,M,K;
string s,t;
int cnt[26];
 
signed main() {
    IOS();
    cin>>N>>s;
    rep(i,0,(int)s.size()){
        cnt[s[i]-'a']++;
    }
    
    int ans=1;
    rep(i,0,26){
        (ans*=cnt[i]+1)%=MOD;
    }
    cout<<(ans-1+MOD)%MOD<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;

int main() {
    int X;
    cin >> X;
    vector<bool> a(X + 3);
    a[0] = true;
    for(int j = 0; j <= 5; ++j)
        for(int i = 0; 100 + i + j <= X; ++i)
            a[i + 100 + j] = a[i + 100 + j] | a[i];
    cout << a[X] << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef unsigned long long u64;

int main(void)
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  u64 a, b, x;
  cin >> a >> b >> x;
  cout << (b/x) - (a/x) + (a%x == 0 ? 1 : 0) << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace AtCoder {
    class Program {
        static void Main() {
            double[] args = Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
            Console.WriteLine(Math.Ceiling(args[0] / args[3]) < Math.Ceiling(args[2] / args[1]) ? "No" : "Yes");
        }
    }
}

Measured memory_bytes: 28252
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x, ans=0;
  cin >>x;
  if(x >= 2000){
    ans = 1;
  }
  else{
    for(int i=0; i<20; i++){
	    if(i*100<=x && x<=i*105){
    	  ans = 1;
      	  break;
        }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
using ll=long long;

const ll INF = pow(10,18)+1;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

template<typename T> bool chmin(T& a, T b) {return a > b ? a = b, true : false;}
template<typename T> bool chmax(T& a, T b) {return a < b ? a = b, true : false;}
 
int main(){
    int N, Q;
    cin >> N >> Q;
    string S;
    cin >> S;
    int tmp[N];
    tmp[0] = 0;
    FOR(i,1,N){
        if(S[i]=='C'&&S[i-1]=='A') tmp[i] = 1 + tmp[i-1];
        else tmp[i] = tmp[i-1];
    }
    vector<int> l,r;
    REP(i, Q){
        int tmpl,tmpr;
        cin >> tmpl >> tmpr;
        l.push_back(tmpl);
        r.push_back(tmpr);
    }
    REP(i, Q){
        cout << tmp[r[i]-1]-tmp[l[i]-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 1000000007;
#define REP(i, n) for(int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	ll n, k; cin >> n >> k;
	vector<ll> a(n), f(n); ll asum = 0;
	REP(i, n)cin >> a[i];
	REP(i, n)cin >> f[i];
	sort(ALL(a)); sort(ALL(f), greater<ll>());
	ll l = 0, r = 300000000000000;
	while (r - l > 1) {
		ll s = l + ((r - l) / 2);
		ll ko = 0;
		REP(i, n) {
			if (s <= a[i] * f[i])
				ko += ((a[i] * f[i] - s) / f[i]) + 1;
		}
		if (ko <= k)
			r = s;
		else
			l = s;
	}
	cout << l;
}

Measured memory_bytes: 3328
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <string>
#include <unordered_map>


int main (void) {
  int N, A, B;
  std::cin >> N >> A >> B;

  int ans = 0;
  for(int i=0; i<=N; i++){
    std::string s = std::to_string(i);

    int sum = 0;
    for(int k=0; k<s.size(); k++){
      sum += (int)(s[k]-'0');
    }
    if ( sum >= A && sum <= B ) ans += i;
  }

  std::cout << ans << std::endl;

  return 0;
}


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

int main() {
  string s,t; cin>>s>>t;
  int n=s.size(),m=t.size();
  vector<string> v;
  rep(i,n-m+1){
    bool b=true;
    for(int j=i; j<i+m; j++){
      if(s[j]!='?'&&s[j]!=t[j-i]){b=false;break;}
    }
    if(b){
      string s_="";
      rep(k,n){
        if( k >=i && k <i+m ){s_+= t[k-i];}
        else if(s[k]=='?'){s_+='a';}
        else{s_+=s[k];}
      }
      v.push_back(s_);
    }
  }
  if(v.size()==0){cout<<"UNRESTORABLE";}
  else{
    sort(v.begin(),v.end());
    cout<<v[0]<<endl;
  }
}

Measured memory_bytes: 3580
using System;

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
			string[] s = Console.ReadLine().Split();
			int N = int.Parse(s[0]);
			int T = int.Parse(s[1]);
			int ans = int.MaxValue;
			for (int i = 0; i < N; i++) {
				string[] vs = Console.ReadLine().Split();
				int c = int.Parse(vs[0]);
				int t = int.Parse(vs[1]);
				if (t <= T && c < ans) {
					ans = c;
				}
			}
			if (ans < int.MaxValue) {
				Console.WriteLine(ans);
			} else {
				Console.WriteLine("TLE");
			}
		}
	}
}


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

int main() {
    int p, q, r;
    cin >> p >> q >> r;
    cout << min({p + q, q + r, r + p}) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
map<int, int> ct;
map<int, int> ct2;

int main() {
    int n;
    scanf("%d", &n);
    long long ans = 0;
    for (int i = 1, x; i <= n; i++) {
        scanf("%d", &x);
//        ans += ct[i - x];
//        ct[i + x]++;
        ct[i - x]++;
        ct2[i + x]++;
    }
    for (int i = 1; i <= 200000; i++) {
        ans += (long long)ct[i] * (long long)ct2[i];
    }
    printf("%lld", ans);
}

Measured memory_bytes: 35844
#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <iomanip>
#include <map>
#include <utility>
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=0;i<=(n);++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int INF = 10000000;

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

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

int main() {
    ll n; cin >> n;
    auto pf = prime_factorize(n);
    ll ans = 0;

    for(auto p : pf) {
        ll e = p.second;
        ll tmp = 0, cur = 1;
        while(e >= cur) {
            e -= cur++;
            ++tmp;
        }
        ans += tmp;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3628
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import Counter

def factorize(n: int):
    d = Counter()
    m= 2
    
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
            
        m += 1
        
    if n > 1:
        d[n] += 1
        
    return d

n,p = li()

facs = factorize(p)

ans = 1
for k in sorted(facs.keys()):
    if facs[k] >= n:
        ans = ans * k**(facs[k]//n)
        
print(ans)

Measured memory_bytes: 3444
N, K = gets.chomp.split(" ").map(&:to_i)
P = Hash.new
Q = Hash.new
N.times{
  x, y = gets.chomp.split(" ").map(&:to_i)
  P[x] = y
  Q[y] = x
}

ans = 10 ** 20
V = Array.new(N).map!{ Array.new(N)}
X = P.keys.sort
Y = P.values.sort
(0...X.size).each{|i|
  (0...Y.size).each{|j|
    V[i][j] = P.count{|k, v| X[i] <= k && Y[j] <= v}
  }
}
(0...X.size).each{|i|
  (0...Y.size).each{|j|
    next if V[i][j] < K
    ((i+1)...X.size).each{|k|
      ((j+1)...Y.size).each{|l|
        wk = V[i][j] + V[k][l] - V[i][l] - V[k][j]
        next if wk < K-2
        next if wk > K
        wk += 1 if Y[j] <= P[X[k]] && P[X[k]] < Y[l]
        wk += 1 if X[i] <= Q[Y[l]] && Q[Y[l]] <= X[k]
        if wk == K then
          w = (X[k]-X[i]) * (Y[l]-Y[j])
          ans = w if ans > w
        end
      }
    }
  }
}

puts ans


Measured memory_bytes: 2172
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int>b(n-1);
  for(int i=0;i<n-1;i++){
    cin>>b.at(i);
  }
  if(n==2){//bがひとつのみ
    cout<<b.at(0)*2;
   return 0;
  }
  vector<int>a(n);
  for(int i=1;i<=n-2;i++){
    if(i==1){//初回
    if(b.at(i-1)>=b.at(i)){
      a.at(i-1)=b.at(i-1);
      a.at(i)=b.at(i);
    }
    else if(b.at(i-1)<b.at(i)){
      a.at(i-1)=a.at(i)=b.at(i-1);
    }
    }
    else{//２回目以降
      if(b.at(i-1)>=b.at(i)){
        a.at(i)=b.at(i);
      }
      else{
        a.at(i)=b.at(i-1);
      }
    }
    if(i==n-2){//〆
        a.at(i+1)=b.at(i);
    }
  }
  int f=0;
  for(int i=0;i<n;i++){
    f+=a.at(i);
  }
  cout<<f;
}
      

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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 

ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos;
ld doua;
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");
char s[100][100];
bool fl;
struct edge{int to,cost;};

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

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

    cin>>h>>w;
    rep(i,h)rep(j,w)cin>>s[i][j];
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='#'){
                int ok=0;
                rep(k,4){
                    int nx=j+dx[k],ny=i+dy[k];
                    if(s[ny][nx]=='#'){
                        ok=1;
                        break;
                    }
                }
                if(!ok){
                    Cout("No");
                    return 0;
                }
            }
        }
    }
    Cout("Yes");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1e9 + 7;
#define pival 3.14159265359
#define pll pair<ll,ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pqq priority_queue
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl '\n'
ll power(ll x, ll y, ll p)
{ 
    ll res = 1;  
    x = x % p;
    while (y > 0) { 
        if (y & 1) res = (res * x) % p; 
        y = y >> 1;
        x = (x * x) % p;   
    } 
    return res; 
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
 	ll n, m;
 	cin >> n >> m;
 	ll sum = 0;
 	ll x;
	for (ll i = 0; i < m; i++) {
		cin >> x;
		sum += x;
	}   
	if (sum > n) {
		cout << -1 << endl;
	}
	else {
		cout << n - sum << endl;
	}
	return 0;
}

Measured memory_bytes: 3656
#include <iostream>

using namespace std;

int main(void) {
    int N;
    cin >> N;
    for(int i=0; i<=N; i++) {
        int tmp = (int)((double)i*1.08);
        if(tmp == N) {
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,b) for(ll i=0;i<b;i++)
#define ll long long
using namespace std;
/*--Input//////////////////////////////////////////////////*/
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
    cin >> first;
    IN(rest...);
    return;
}
#define SS(T, ...)      T __VA_ARGS__; IN(__VA_ARGS__);
#define SV(type,c,n) vector<type> c(n);for(auto& i:c)cin >> i;
/*--Output/////////////////////////////////////////////////*/
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
inline int p(void){cout << endl; return 0;}
template<class Head> int p(Head&& head){cout << head;p();return 0;} template<class Head,class... Tail> int p(Head&& head,Tail&&... tail){cout<<head<<" ";p(forward<Tail>(tail)...);return 0;}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vvvl vector<vector<vector<ll>>>
#define debug(x) cerr<<#x<<" "<<x<<'\n';
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL<<(n))

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; }
bool cmp(pair<ll,ll> a, pair<ll,ll> b) { return a.second < b.second; }

ll MOD = 1000000007;

int main() {
    SS(int,k)
    string ans="";
    rep(i,k){
        ans+="ACL";
    }
    p(ans);
}

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

int main() {
  int x, ans;
  cin >> x;
  if (x==0){
    ans = 1;
  }else{
    ans = 0;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef pair<string , int> s_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
//#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
const int64 INF = 1LL << 58;
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 (a>b) { a=b; return 1; } return 0; }
template<typename T> void remove(T & vector, unsigned int index){vector.erase(vector.begin() + index);}

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

    int N; cin >> N;
    vel A(N), B(N); rep(i,N) cin >> A[i] >> B[i];

    ll ans  = 0;
    for(int i = N - 1; i >= 0; i--) {
        A[i] += ans;
        if(A[i] % B[i] == 0) continue;
        ans += B[i] - ( A[i] % B[i] );
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
#include<string.h>
char S[1005],R[1005],L[1005],ST[1500],tmp[1005],V[128];
int sp,rp,np,LP,i;
char pop(){return ST[--sp];}
void push(char c){ST[sp++]=c;}
void NotPOP(){for(;ST[sp-1]=='-';tmp[rp++]=ST[--sp]);}
void p(char *s)
{
	memset(tmp,0,sizeof(tmp));
	for(np=sp=rp=0;s[np];np++)
	{
		char t=s[np];
		if(t=='-'&&s[np+1]=='>'){push('>');np++;}
		else if(t=='*'||t=='+'||t=='-'||t=='(')push(t);
		else if((t=='T'||t=='F')||('a'<=t&&t<='k')){tmp[rp++]=s[np];NotPOP();}
		else{tmp[rp++]=pop();sp--;NotPOP();}
	}
	strcpy(s,tmp);
}

char c(char *s)
{
	memset(ST,0,sizeof(ST));
	for(np=sp=rp=0;s[np];np++)
	{
		char t=s[np];
		if(t=='T')push(1);
		else if(t=='F')push(0);
		else if('a'<=t&&t<='k')push((LP>>V[t])&1);
		else if(t=='*')push(pop()&pop());
		else if(t=='+')push(pop()|pop());
		else if(t=='-')push(!pop());
		else if(t=='>')
		{
			char a=pop(),b=pop();
			push(!b|a);
		}
	}
	return ST[0];
}

int main()
{
	for(i=0;i<=11;i++)V[i+'a']=i;
	for(;gets(S),S[0]!='#';)
	{
		sscanf(S,"%[^=]=%s",R,L);
		p(R);p(L);
		for(LP=0;LP<1<<12;LP++)
			if(c(R)!=c(L))
				break;
		puts(LP==1<<12?"YES":"NO");
	}
	return 0;
}

Measured memory_bytes: 544
N = int(input())
inf = 10**18
G = [[inf]*N for _ in range(N)]
edges = [[-1]*N for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    edges[a-1][b-1] = i
    edges[b-1][a-1] = i
use = [-1]*N
que = [0]
use[0] = 0
while que:
    v = que.pop()
    u = use[v]
    for nv in range(N):
        if edges[v][nv] == -1 or use[nv] != -1:
            continue
        i = edges[v][nv]
        use[nv]=u^(1<<i)
        que.append(nv)
M = int(input())
uv = [list(map(int, input().split())) for _ in range(M)]
used = [0]*(1<<M)
cnt = [0]*(1<<M)
ans = 0
for s in range(1, 1<<M):
    for i in range(M):
        if (s>>i)&1:
            u, v = uv[i]
            u, v = u-1, v-1
            p = s^(1<<i)
            used[s] = used[p]|(use[u]^use[v])
            cnt[s] = cnt[p]^1
            break
    res = 0
    for i in range(N-1):
        if used[s]&(1<<i):
            res+=1
    ans+=(-1)**cnt[s]*pow(2, N-1-res)
print(pow(2, N-1)+ans)








Measured memory_bytes: 61660
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


# --------------------------------------------

dp = None


def main():
    N, M = li_input()
    A = li_input()

    ans = 0
    d = collections.defaultdict(lambda: 0)

    cumsum = [0]
    c_sum = 0
    for a in A:
        c_sum = (c_sum + a) % M
        cumsum.append(c_sum)

    for c in cumsum:
        d[c] += 1

    for v in d.values():
        if v >= 2:
            ans += v * (v - 1) // 2

    print(ans)


main()


Measured memory_bytes: 18552
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author CompuWare
 */

#include <iostream>
#include <fstream>

#include <iostream>

using namespace std;

class ASecurity {
public:
    void solve(std::istream &in, std::ostream &out) {
        string s;
        in >> s;
        for (int i = 1; i < s.size(); i++) {
            if (s[i] == s[i - 1]) {
                out << "Bad";
                return;
            }
        }
        out << "Good";
    }
};


int main() {
    ASecurity solver;
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    solver.solve(in, out);
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

string s;

int main(){
	cin >> s;
	ll ans = 0;
	rep(i,s.size()){
		FOR(j,i,s.size()){
			bool ok = true;
			FOR(k,i,j+1){
				if(s[k] != 'A' && s[k] != 'T' && s[k] != 'C' && s[k] != 'G'){
					ok = false;
				}
			}
			if(ok)ans = max(ans,(ll)(j-i+1));
		}
	}
	cout << ans << endl;
}


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

//create arrays outside of main()

int years[9];

int main(){

    int n;

    cin >> n;

    for(int i=1; i<10; i++){
        years[i-1] = i*111;
    }

    for(int j=0; j<9; j++) {
        if(n<=years[j]){
            cout << years[j];
            break;
        }
    }

    return 0;
}

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

const int MOD = 1e9 + 7;

struct mod_matrix {
    static const uint64_t ULL_BOUND = numeric_limits<uint64_t>::max() - (uint64_t) MOD * MOD;

    int rows, cols;
    vector<vector<int>> values;

    mod_matrix(int r = -1, int c = -1) : rows(r), cols(c) {
        if (cols < 0)
            cols = rows;

        if (rows > 0)
            values.assign(rows, vector<int>(cols, 0));
    }

    mod_matrix(const vector<vector<int>> &v) {
        assert(!v.empty());
        values = v;
        rows = v.size();
        cols = v[0].size();
    }

    bool is_square() const {
        return rows == cols;
    }

    void make_identity() {
        assert(is_square());

        for (int i = 0; i < rows; i++)
            for (int j = 0; j < cols; j++)
                values[i][j] = i == j ? 1 : 0;
    }

    void clean_values() {
        for (int i = 0; i < rows; i++)
            for (int j = 0; j < cols; j++)
                values[i][j] = (values[i][j] % MOD + MOD) % MOD;
    }

    mod_matrix operator*(mod_matrix &other) {
        assert(cols == other.rows);
        clean_values();
        other.clean_values();

        mod_matrix product(rows, other.cols);
        vector<uint64_t> row;

        for (int i = 0; i < rows; i++) {
            row.assign(other.cols, 0);

            for (int j = 0; j < cols; j++)
                if (values[i][j] != 0)
                    for (int k = 0; k < other.cols; k++) {
                        row[k] += (uint64_t) values[i][j] * other.values[j][k];

                        if (row[k] > ULL_BOUND)
                            row[k] %= MOD;
                    }

            for (int k = 0; k < other.cols; k++)
                product.values[i][k] = row[k] % MOD;
        }

        return product;
    }

    mod_matrix& operator*=(mod_matrix &other) {
        assert(other.is_square() && cols == other.rows);
        return *this = *this * other;
    }

    mod_matrix power(long long p) {
        assert(is_square());
        mod_matrix result(rows), temp = *this;
        result.make_identity();

        while (p > 0) {
            if (p & 1)
                result *= temp;

            if (p > 1)
                temp *= temp;

            p >>= 1;
        }

        return result;
    }

    void print() {
        for (int i = 0; i < rows; i++)
            for (int j = 0; j < cols; j++)
                cerr << values[i][j] << (j < cols - 1 ? ' ' : '\n');
    }
};

int N;
long long K;
vector<vector<int>> A;

int main() {
    scanf("%d %lld", &N, &K);
    A.assign(N, vector<int>(N));

    for (int i = 0; i < N; i++)
        for (int j = 0; j < N; j++)
            scanf("%d", &A[i][j]);

    mod_matrix result = mod_matrix(A).power(K);
    long long paths = 0;

    for (int i = 0; i < N; i++)
        for (int j = 0; j < N; j++)
            paths += result.values[i][j];

    printf("%lld\n", paths % MOD);
}


Measured memory_bytes: 256
num = int(input())
def chain(L, x, y):
    if L[y][x] == 0:
        return
    L[y][x] = 0
    for i in range(-3, 4):
        nx = x + i
        if nx in range(8):
            if L[y][nx] > 0:
                chain(L, nx, y)
        ny = y + i
        if ny in range(8):
            if L[ny][x] > 0:
                chain(L, x, ny)
    return

for k in range(num):
    input()
    L = []
    for i in range(8):
        l = [int(x) for x in input()]
        L.append(l)
    x = int(input())-1
    y = int(input())-1

    chain(L, x, y)

    print("Data {}:".format(k+1))

    for l in L:
        print( "".join(map(str,l)) )






Measured memory_bytes: 5624
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    long[] a = new long[n];
    long[] g = new long[n];

    for(int i=0;i<n;i++){
      a[i] = scan.nextLong();
      g[i] = a[i];
    }

    Arrays.sort(a);
    int b = (int) (n-1)/2;
    int c = b+1;
    long d = a[b];
    long e = a[c];

    for(int i=0;i<n;i++){
      if (g[i] <= d){
        System.out.println(e);
      }
      else{
        System.out.println(d);
      }
    }

  }
}


Measured memory_bytes: 67248
#include<bits/stdc++.h>
using namespace std;
int main()
{

int arr[3];
for(int i=0;i<3;i++)
    cin>>arr[i];
sort(arr,arr+3);

    cout<<(arr[1]-arr[0])+(arr[2]-arr[1])<<endl;


    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

int main(){
  std::string a, b;
  std::cin >> a >> b;
  int ia, ib;
  ia = atoi(a.c_str()); ib = atoi(b.c_str());
  std::string s1, s2;
  for(int i = 0; i != ia; ++i)
    s1 += b;
  for(int i = 0; i != ib; ++i)
    s2 += a;
  if(s1 < s2)
    std::cout << s1 << std::endl;
  else
    std::cout << s2 << std::endl;
  return 0;
}


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

int main() {
  int k,x;
  scanf("%d %d", &k, &x);
  const int min_ = max(-1000000, x-k+1);
  const int max_ = min(+1000000, x+k-1);
  for (int i=min_; i<=max_; i++) {
    printf("%d ", i);
  }
  printf("\n");
  return 0;
}

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

int main(){

    while(true){
        
        string n;
        cin>>n;
        
        if(n[0]=='0'&&n.size()==1)break;
        
        int ans=0;
        reverse(n.begin(),n.end());
        for(int i=0;i<n.size();i++){
            
            int num=n[i]-'0';
            
            ans=ans+num;
        }
        
        cout<<ans<<endl;
    }
	
	return 0;
	
}


Measured memory_bytes: 3184
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main() {
  ll n, d;
  cin >> n >> d;
  ll ans = 0;
  rep(i,n){
    ll x, y;
    cin >> x >> y;
    if(x < 0){
      x = -x;
    }
    if(y < 0){
      y = -y;
    }
    if(x*x + y*y <= d*d){
      ans = ans + 1;
    }
  }
  cout << ans;
  
    
  return 0;
}

Measured memory_bytes: 3632
#include <cstdio>
#include <cstdlib>
#include <cstring>
//using namespace std;

struct Node{
    int key;
    Node *prev, *next;
};

Node *nil;

void init(){
    nil = (Node *)malloc(sizeof(Node));
    nil->next = nil;
    nil->prev = nil;
}

void printList(){
    Node *cur = nil->next;
    int is_first = 0;
    while (true){
        if (cur == nil){
            break;
        }
        if (is_first++ > 0){
            printf(" ");
        }
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}

void insert(int key){
    Node *x = (Node *)malloc(sizeof(Node));
    x->key = key;
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

Node* listsearch(int key){
    Node *cur = nil->next;
    while (cur != nil && cur->key != key){
        cur = cur->next;
    }
    return cur;
}

void deleteNode(Node *t){
    if (t == nil){
        return;
    }
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

void deleteFirst(){
    deleteNode(nil->next);
}

void deleteLast(){
    deleteNode(nil->prev);
}

void deleteKey(int key){
    deleteNode(listsearch(key));
}

int main(){
    int n,key;
    char s[20];
    scanf("%d", &n);
    init();
    for (int i = 0; i < n; i++){
        scanf("%s%d",s,&key);
        if (s[0] == 'i'){
            insert(key);
        }
        else if (s[0] == 'd'){
            if (strlen(s) < 7){
                deleteKey(key);
            }
            else if (s[6] == 'F'){
                deleteFirst();
            }
            else{
                deleteLast();
            }
        }
    }
    printList();
    return 0;
}


Measured memory_bytes: 33828
/////////////////////////////////////////////

//
//	FileName	:	First.cpp
//	Creator		:	Fm
//	Date		:	2019-11-20 00:21
//	Comment		:	OJ(P4328)
//
///////////////////////////////////////////

//#include "pch.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <stack>
#include <string>
#include <string.h>
#include <set>
#include <queue>
#include <map>

using namespace std;
#define	MAXNUM		10010
#define	EPS         0.0001
#define MODNUM		2e31


typedef unsigned char       BYTE;
typedef int                 BOOL;
typedef unsigned long       DWORD;


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

	int				nA;
	int				nB;
	scanf("%d%d", &nA, &nB);
	cout << ceil(1.0 * (nA + nB) / 2 )<< endl;
Exit0:

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>

const int INT_INF = 1000000000;                 // 10^9
const long long LONG_INF = 1000000000000000000; // 10^18

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 1; i <= n; i++)
    {
        int b;
        cin >> b;
        a[b - 1] = i;
    }

    cout << a[0];
    for (int i = 1; i < n; i++)
    {
        cout << " " << a[i];
    }
    cout << endl;

    return 0;
}

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



#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)

using namespace std;

template <class T>
using vec = std::vector<T>;
typedef long long ll;
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; }

const long long INF = 1LL<<60;

int lcm(int a,int b){
    //最小公倍数
    return a/__gcd(a,b) * b;
}

int n;

int main()
{
    cin>>n;
    set<string> S;

    string tmp;
    rep(i,n){
        cin>>tmp;
        S.insert(tmp);
    }
    
    cout<<S.size()<<endl;

    return 0;

}




Measured memory_bytes: 19252
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<numeric>
#include<algorithm>
#include<complex>
#include<queue>
#include<stdlib.h>
#include<map>
#include<cmath>

#define ll long long

using namespace std;

int main(){
    int N,K;
    cin >> N >> K;
    vector<int> vec(N,0);
    for(int i=0;i<N;i++){
        cin >> vec[i];
    }
    vector<int> dp(N,0);
    dp[1]=abs(vec[1]-vec[0]);
    for(int i=2;i<N;i++){
        dp[i]=INFINITY;
        for(int j=1;j<=K;j++){
            if(i-j>=0){
                dp[i]=min(dp[i-j]+abs(vec[i]-vec[i-j]),dp[i]);
            }
        }
    }
    cout << dp[N-1] << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 1000000007
#define NUM 100005
void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int cmp(const void* a,const void* b){return *(int*)a-*(int*)b;}

int main() {
  int N,Q,i,ans=0,n=0;
  scanf("%d%d",&N,&Q);
  char S[N];
  int l[Q],r[Q],a[N];
  scanf("%s",S);
	FOR(i,0,Q)scanf("%d%d",&l[i],&r[i]);
  a[0]=0;
  FOR(i,0,N-1){
    if(S[i]=='A'&&S[i+1]=='C')n++;
    a[i+1]=n;
  }
  FOR(i,0,Q)printf("%d\n",a[r[i]-1]-a[l[i]-1]);

  //printf("%d\n",ans);
	return 0;
}


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

typedef long long ll;

int main () {
	int N, K;
	int s[101] = {0};
	cin >> N >> K;
	for (int i=0; i<K; i++) {
		int d, a;
		cin >> d;
		while (d-- > 0) {
			cin >> a;
			s[a] ++;
		}
	}
	int cnt = 0;
	for (int i=1; i<=N; i++)
		if (s[i] == 0)
			cnt ++;
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 3632
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Set;
import java.util.HashSet;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        br.readLine();
        String[] s = br.readLine().split(" ");
        br.readLine();
        String[] t = br.readLine().split(" ");
        
        Set<String> set = new HashSet<String>(Arrays.asList(s));
        set.retainAll(Arrays.asList(t));
        System.out.println(set.size());
    }
}


Measured memory_bytes: 27708
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 19 20:17:38 2020

@author: liang
"""
#B
N = int(input())
count = 0
for i in range(N):
    a, b = map(int,input().split())
    if a == b:
        count += 1
    else:
        count = 0
    if count >= 3:
        print("Yes")
        break
else:
    print("No")

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

int main(){
  int X,Y,Z;
  cin >> X >> Y >> Z;
  cout << Z << " " << X << " " <<  Y << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.util.Map.Entry;
 
public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		sc.nextLine();
		Map<Integer,Shop> map = new HashMap<Integer,Shop>();
		for(int tmp = 1 ; tmp<=n; tmp++) {
			String s = sc.next();
			int point = sc.nextInt();
			Shop shop = new Shop(s,point);
			map.put(tmp, shop);
		}
		List<Entry<Integer, Shop>> list_entries = new ArrayList<Entry<Integer, Shop>>(map.entrySet());
		
		Collections.sort(list_entries, new Comparator<Entry<Integer, Shop>>() {
	    	  @Override
	    	    public int compare(Entry<Integer, Shop> obj0, Entry<Integer, Shop> obj1) {
	    	        int ret = obj0.getValue().getCity().compareTo(obj1.getValue().getCity());
	    	        if (ret != 0) {
	    				return ret;
	    			}
	    	        return Integer.compare(obj1.getValue().getPoint(), obj0.getValue().getPoint());
	    	    }
	    	});
		
		for(Entry<Integer, Shop> shop :  list_entries) {
			System.out.println(shop.getKey());
		}

	  }
	
	static class Shop {
		private String city;
		
		private int point;

		public Shop(String city, int point) {
			super();
			this.city = city;
			this.point = point;
		}

		public String getCity() {
			return city;
		}


		public int getPoint() {
			return point;
		}

		
	}
}

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


long long int gcd(long long int a,long long int b){
	long long int q;
	q=a%b;
	if(q==0)return b;
	a=b;
	b=q;
	return gcd(a,b);
}
int main(){
	long long int a,b,q,g;
	while(cin>>a&&cin>>b){
		if(b>a){
			q=a;
			a=b;
			b=q;
		}
		g=gcd(a,b);
		cout<<g<<" "<<a*b/g<<endl;
	}
	return 0;
}

Measured memory_bytes: 3060
import sys
import socket

if socket.gethostname() in ['N551J', 'F551C']:
    sys.stdin = open('c1.in')


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


def read_int():
    return int(input())


def read_str_list():
    return input().split()


def read_str():
    return input()


def solve():
    n = read_int()
    s = read_str()

    cache = {}

    def rec(red, blue):
        if (red, blue) in cache:
            return cache[(red, blue)]
        nr = len(red)
        nb = len(blue)
        if nr > n or nb > n:
            res = 0
            cache[(red, blue)] = res
            return res
        if nr + nb == 2 * n:
            res = 1
            cache[(red, blue)] = res
            return res
        c = s[nr + nb]
        res = 0
        if nr + nb < n or (nr < n and c == blue[nr - n]):
            res += rec(red + c, blue)
        if nr + nb < n or (nb < n and c == red[n - 1 - nb]):
            res += rec(red, c + blue)
        cache[(red, blue)] = res
        return res

    res2 = rec('', '')
    return res2


def main():
    res = solve()
    print(res)


if __name__ == '__main__':
    main()


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

int main(){
  int N,sum=0;
  cin >> N;
  int a[N];
  for(int i=0;i<N;i++){
    cin >> a[i];
    sum += a[i];
  }
  sort(a,a+N);
  cout << sum - a[N-1]/2 << endl;
}

Measured memory_bytes: 256
#include <map> 
#include <queue>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
#define int long long
int a[100005];
map <int, int> M, M1;
int k1[100005], k2[100005], cnt;
signed main () {
	int n, ans = 0;
	scanf ("%lld", &n);
//	ans = n;
	for (int i = 1; i <= n; i++) {
		scanf ("%lld", &a[i]);
		for (int j = 2; j * j * j <= a[i]; j++) while (a[i] % (j * j * j) == 0) a[i] /= (j * j * j);
		M[a[i]]++;
//		printf ("(%lld)\n", a[i]);
	}
	if (M[1]) {
//		ans ++;
		M[1] = 1;
	}
	for (int i = 1; i <= n; i++) {
		int op = 1, pl = a[i];
		if (M1[a[i]]) continue;
		M1[a[i]] = 1;
		for (int j = 2; j * j <= pl && j <= 3300; j++) {
			if (pl % j == 0) {
				if (pl % (j * j) == 0) op *= j, pl /= j * j;
				else op *= j * j, pl /= j;
			}
		}
//		if (i == 3) printf ("--%lld--", op);
		if ((int)sqrt (pl) * (int)sqrt (pl) == pl) op *= sqrt (pl);
		else op *= pl * pl;
		ans += max (M[op], M[a[i]]);
		M[op] = 0, M[a[i]] = 0;
//		printf ("[%lld %lld]", op, a[i]);
	}
	printf ("%lld", ans);
	return 0;
} 

Measured memory_bytes: 22688
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int i,n;
        double sum,a,m,sig,sigma;
        while(true) {
        	sum=0;
        	sig=0;
        	n=scan.nextInt();
        	if(n==0) {
        		break;
        	}
        	double s[]=new double[n];
        	for(i=0;i<n;i++) {
        		s[i]=scan.nextDouble();
        		sum+=s[i];
        	}
        	m=sum/n;
        	for(i=0;i<n;i++) {
        		sigma=Math.pow(s[i]-m,2);
        		sig+=sigma;
        	}
        	a=Math.sqrt(sig/n);
        	System.out.println(a);
        }
    }
}


Measured memory_bytes: 39728
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

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 ans = 0;
        for(int i=a;i<=b;i++){
            if(c%i==0){
                ans++;
            }
        }
        System.out.println(ans);                
    }    
}



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

int main() {
  int k, t;
  cin >> k >> t;
  vector<int> a(t);
  int mx = 0;
  int sum = 0;
  rep(i, t){
    cin >> a[i];
    mx = max(mx, a[i]);
    sum += a[i];
  }
  if(2 * mx - sum > 1){
    cout << 2 * mx - sum - 1 << endl;
  }else{
    cout << 0 << endl;
  }
}

Measured memory_bytes: 3600
n, k = map(int, input().split())
ans_list = []

for i in range(k):
  d = int(input())
  if d == 1:
    ans_list.append(int(input()))
  else:
    ans_list[len(ans_list):len(ans_list)] = map(int, input().split())

print(n - len(list(set(ans_list))))

Measured memory_bytes: 9184
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll to;
	ll d;
};


///////////////////////////


int main() {

	ll N;
	ll R;
	cin >> N >> R;

	ll ans;

	if (N > 10) { ans = R; }
	else { ans = R + 100 * (10 - N); }


	cout << ans;
	
	system("PAUSE");

	

}


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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int t; cin>>t; while(t--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
double PI = 4*atan(1);

int main()
{
    optimize();

int n;
cin>> n;

ll b[n+1], sum= 0;

for(int i= 0; i<n-1; i++)
{
    cin>> b[i];

    sum+= (i ==0? b[i] : min( b[i], b[i-1]));

}

sum += b[n-2];
cout<< sum ;
nl;

    return 0;
}




Measured memory_bytes: 3644
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC115A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = int.Parse(Console.ReadLine());

            if (n == 25) 
            {
                Console.Write("Christmas");
            }
            else if (n==24)
            {
                Console.Write("Christmas Eve");
            }
            else if (n == 23)
            {
                Console.Write("Christmas Eve Eve");
            }
            else if (n == 22)
            {
                Console.Write("Christmas Eve Eve Eve");
            }
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,y;
    cin>>x>>y;
    if(x==2)
    {
        if(y==2)
            cout<<"Yes";
        else
            cout<<"No";
    }
    else if(x==4 || x==6 || x==9 || x==11)
    {
        if(y==4 || y==6 || y==9 || y==11)
            cout<<"Yes";
        else
            cout<<"No";
    }
    else
    {
        if(y==2 || y==4 || y==6 || y==9 || y==11)
            cout<<"No";
        else
            cout<<"Yes";
    }
}


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

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

  int ret = 0;
  for (int i = 0; i < n; ++i) {
    int l, r;
    cin >> l >> r;
    ret += r - l + 1;
  }
  cout << ret << "\n";
  return 0;
}


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

#define int long long
#define cint cpp_int
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

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;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

struct edge{int to,cost;};
struct graph{
    int N;  
    vector< vector<edge> > G;
    VVi dist;
    graph(int n){
        init(n);
    }
    void init(int n){
        N = n;
        G.resize(N);
        dist.resize(N);
        REP(i,0,N) dist[i].resize(N);
        REP(i,0,N){
            REP(j,0,N){
                dist[i][j] = INF;
            }
        }
    }
    void add_edge(int s,int t,int cost){
        edge e;
        e.to = t, e.cost = cost;
        G[s].push_back(e);
    }
    void warshall_floyd(){
        REP(i,0,N){
            dist[i][i]=0;
        }
        REP(i,0,N){
            for(auto e : G[i]){
                dist[i][e.to]=e.cost;
                dist[e.to][i]=e.cost;
            }
        }
        REP(i,0,N){
            REP(j,0,N){
                REP(k,0,N){
                    chmin(dist[j][k],dist[j][i]+dist[i][k]);
                }
            }
        }
    }
};

signed main(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);
    int n,m,r;
    cin>>n>>m>>r;
    Vi town(r),a(m),b(m),c(m);
    REP(i,0,r){
        cin>>town[i];
        town[i]--;
    }
    REP(i,0,m){
        cin>>a[i]>>b[i]>>c[i];
        a[i]--;b[i]--;
    }

    graph G(n);
    REP(i,0,m){
        G.add_edge(a[i],b[i],c[i]);
        G.add_edge(b[i],a[i],c[i]);
    }

    G.warshall_floyd();

    int ans=INF;
    sort(ALL(town));
    do{
        int tmp=0;
        REP(i,1,town.size()){
            tmp += G.dist[town[i-1]][town[i]];
        }
        chmin(ans,tmp);
    }while(next_permutation(ALL(town)));    
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1920