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

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


#ifdef LOCAL
#define show(x) cerr<<__LINE__" : "<<#x<<" = "<<(x)<<endl
#else
#define show(x) true
#endif

using namespace std;
using ll = long long;
template<class T>
using V=vector<T>;

template<class T, class U>
void chmin(T &t, const U u) { if (t > u) t = u; }

template<class T, class U>
void chmax(T &t, const U u) { if (t < u) t = u; }

const int INF = (1 << 30) - 1;
const ll INFL = (ll) 5e15;
const int MOD = 1e9 + 7;

class Solver {
public:
    bool solve() {
        cin >> S;
        if (S == "#") return false;

        int sz = 0;
        for (auto c:S) {
            if (c == '/') sz++;
        }
        grid.resize(sz + 1);

        int l = 0;
        for (auto c:S) {
            if (c == 'b') {
                grid[l].emplace_back(1);
            } else if (c == '/') {
                l++;
            } else {
                for (int len = c - '0', i = 0; i < len; i++) {
                    grid[l].emplace_back(0);
                }
            }
        }

        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--;
        b--;
        c--;
        d--;
        grid[a][b] = 0;
        grid[c][d] = 1;

        int len = 0;
        REP(y, grid.size()) {
            REP(x, grid[y].size()) {
                if (grid[y][x] == 1) {
                    if (len != 0) {
                        cout << len;
                        len = 0;
                    }
                    cout << 'b';
                } else {
                    len++;
                }
            }
            if (len != 0) {
                cout << len;
                len = 0;
            }
            if(y+1!=grid.size()){
                cout << '/';
            }
        }
        cout << endl;

        return true;
    }

private:
    string S;
    V<V<int>> grid;
};

int main() {

    while (Solver().solve());

    return 0;
}


Measured memory_bytes: 3208
class BIT: # 1Indexed
    def __init__(self,size):
        self.array = [0]*size
        self.size  = size
    def add(self,ind,value):
        while ind <= self.size:
            self.array[ind-1] += value
            ind += ind & -ind
    def sum(self,x):
        out = 0
        while x > 0:
            out += self.array[x-1]
            x -= x & -x
        return out

################### ABC174F ###################

import sys
input = sys.stdin.readline

def main(N,Q,c,q):
    bit = BIT(N)
    rbi= {}
    ans = [0]*Q
    q.sort(key= lambda x:x[1])
    R = 0
    for l,r,ind in q:
        for i in range(R,r):
            if c[i] in rbi:
                bit.add(rbi[c[i]],-1)
            rbi[c[i]] = i+1
            bit.add(rbi[c[i]],1)
        ans[ind] = bit.sum(r)-bit.sum(l-1)
        R = r
    return ans

if __name__ == "__main__":
    N,Q = map(int,input().split())
    c = list(map(int,input().split()))
    q = list( list(map(int,input().split()))+[i] for i in range(Q))
    ans = main(N,Q,c,q)
    for i in ans:
        print(i)

Measured memory_bytes: 247448
#include <iostream>
using namespace std;
int main(){
  int n,mx,mn;

  while( cin>>n && n ){
    int sum=0;
    mx = -1;
    mn = 10000;
    for( int i=0,j;i<n;i++ ){
      cin >> j;
      sum +=j;
      if( j>mx ) mx=j;
      if( j<mn ) mn =j;
    }

    sum = (sum - mx -mn)/(n-2);
    cout << sum << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>

using namespace std;
typedef long long ll;

int main(){
    ll n, c;
    cin >> n >> c;
    vector<array<ll, 3>> sch(2 * n);
    for(int i = 0; i < n; ++i){
        ll si, ti, ci;
        cin >> si >> ti >> ci;
        ci--;

        sch.at(2 * i).at(0) = si;
        sch.at(2 * i).at(1) = 0;
        sch.at(2 * i).at(2) = ci;

        sch.at(2 * i + 1).at(0) = ti;
        sch.at(2 * i + 1).at(1) = 1;
        sch.at(2 * i + 1).at(2) = ci;
    }
    sort(sch.begin(), sch.end());

    ll ans = 0, nused = 0;
    vector<ll> used(c, 0);
    for(auto& a : sch){
        if(a.at(1) == 0){ // start
            if(used.at(a.at(2)) == 0){
                nused++;
            }
            used.at(a.at(2))++;
        }else{ // end
            used.at(a.at(2))--;
            if(used.at(a.at(2)) == 0){
                nused--;
            }
        }
        ans = max(nused, ans);
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
#define chmax(x, v) do { x = max(x, v); } while (0)
#define chmin(x, v) do { x = min(x, v); } while (0)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;

// p[i][j]: 先頭がi、終端がjの数列でX-Yの最大値
ll p[4000][4000];

ll N;
vector<ll> a;

signed main() {
  cin >> N;
  a.resize(N);
  rep(i, N)
    cin >> a[i];
  rep(i, 4000) { p[i][i]  = 0; }
  for (ll len = 1; len <= 4000; len++) {
    rep(i, 3999) {
      ll j = i+len;
      if (j > N) continue;
      p[i][j] = max(a[i]-p[i+1][j], a[j-1]-p[i][j-1]);
    }
  }
  cout << p[0][N] << endl;
  return 0;
}


Measured memory_bytes: 124928
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>


using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007



ll n, x, s[310000];
bool used[310000];
queue<ll> q;
int main() {
	cin >> n >> x;
	if (n == 2) {
		if (x == 2) {
			cout << "Yes" << endl;
			REPO(i, 3)cout << i << endl;
		}
		else cout << "No" << endl;
	}
	else {
		if (x == 1 or x == 2 * n - 1) cout << "No" << endl;
		else {
			FOR(i, -2, 1) {
				s[n + i] = x + i + 1;
				used[x + i + 1] = true;
			}
			if (x != 2) {
				s[n + 1] = x - 2;
				used[x - 2] = true;
			}
			else {
				s[n - 3] = x + 2;
				used[x + 2] = true;
			}
			REPO(i, 2 * n - 1) {
				if (!used[i]) q.push(i);
			}
			REP(i, 2 * n - 1) {
				if (s[i] == 0) {
					s[i] = q.front();
					q.pop();
				}
			}
			cout << "Yes" << endl;
			REP(i, n * 2 - 1) cout << s[i] << endl;
		}
	}
}



Measured memory_bytes: 4736
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
#include <map>
#include <cstdlib>
#include <bitset>
#include <assert.h>
//defines
#define f first
#define s second
#define ll long long
#define ull unsigned long long
#define mp make_pair
#define pb push_back
#define vi vector <int>
#define ld long double
#define pii pair<int, int>
const int N = int(3e5), mod = int(1e9)  + 7; 
//functions


using namespace std;    



int main () {
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    int a[3],d;
    for(int i = 0; i<3; i++){
    	cin>>a[i];
    }
    cin>>d;
    sort(a,a+3);
    while(d--){
    	a[2]<<=1;
    }
    cout<<a[2] + a[1] + a[0]<<"\n";
return 0;
}

Measured memory_bytes: 256
n, a, b = map(int, input().split())
result = []

for i in range(n + 1):
  n_list = [int(j) for j in list(str(i))]
  keta_sum = sum(n_list)
  if a <= keta_sum and keta_sum <= b:
    result.append(i)
  else:
    pass
print(sum(result))

Measured memory_bytes: 3296
#include<bits/stdc++.h>
using namespace std;
int main(){
  string a,b,c;
  cin>>a>>b>>c;
  int n =a.size();
  int m =b.size();
  if((a.at(n-1)==b.at(0))&&(c.at(0)==b.at(m-1)))
  cout << "YES" <<endl;
  else cout << "NO" <<endl;
}

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

//main関数
int main() {
    //入力
    long N;
    cin>>N;
    vector<string> S(N);
    vector<long> P(N);
    vector<pair<string,long>> A(0);
    for(int i=0;i<N;i++){
        cin>>S.at(i)>>P.at(i);
        A.push_back(make_pair(S.at(i),1000-P.at(i)));
    }
    
    //計算
    sort(A.begin(),A.end());
    
    //出力
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(A.at(i).second==1000-P.at(j)) cout<<j+1<<endl;
        }
    }
}

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

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

        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        String cardsOfA = input.readLine();
        String cardsOfB = input.readLine();
        String cardsOfC = input.readLine();

        int lengthOfCardsOfA = cardsOfA.length();
        int lengthOfCardsOfB = cardsOfB.length();
        int lengthOfCardsOfC = cardsOfC.length();

        int currentCardPositionOfA = 0;
        int currentCardPositionOfB = 0;
        int currentCardPositionOfC = 0;

        boolean isWinnerDetermined = false;
        char nameOfWinner = ' ';
        char currentPlayer = 'a';
        while (!isWinnerDetermined) {
            if (currentPlayer == 'a') {
                if (doesPlayerFinish(currentCardPositionOfA, lengthOfCardsOfA)) {
                    isWinnerDetermined = true;
                    nameOfWinner = 'A';
                } else {
                    currentPlayer = cardsOfA.charAt(currentCardPositionOfA);
                    currentCardPositionOfA += 1;
                }
            } else if (currentPlayer == 'b') {
                if (doesPlayerFinish(currentCardPositionOfB, lengthOfCardsOfB)) {
                    isWinnerDetermined = true;
                    nameOfWinner = 'B';
                } else {
                    currentPlayer = cardsOfB.charAt(currentCardPositionOfB);
                    currentCardPositionOfB += 1;
                }

            } else if (currentPlayer == 'c') {
                if (doesPlayerFinish(currentCardPositionOfC, lengthOfCardsOfC)) {
                    isWinnerDetermined = true;
                    nameOfWinner = 'C';
                } else {
                    currentPlayer = cardsOfC.charAt(currentCardPositionOfC);
                    currentCardPositionOfC += 1;
                }
            }
        }



        System.out.println(nameOfWinner);


    }

    private static boolean doesPlayerFinish(int currentCardPositionOfThePlayer, int lengthOfCardsOfThePlayer) {
        return currentCardPositionOfThePlayer >= lengthOfCardsOfThePlayer;
    }

}

Measured memory_bytes: 24916
//ALDS1_4_D_Allocation.cpp

#include<bits/stdc++.h>
using namespace std;
const int INF=2E9;
typedef pair<int,int> Pair;
typedef long long LL;

int v(int k, int n, int w[],int p){
    int sum=1;
    int tmp=p;
    int ret=0;
    for(int i=0;i<n;i++){
        if(tmp-w[i]>=0) tmp-=w[i];
        else if(sum==k) break;
        else{
            tmp=p-w[i];
            sum++;
        }
        ret++;
    }

    return ret;
}

int BinarySearch(int k,int n,int w[],int maxw){
    int left = maxw;
    int right = maxw*n+1;
    while(left<right){
        int mid=(left+right)/2;
        if(v(k,n,w,mid)==n && (v(k,n,w,mid-1)!=n) || mid==maxw){
            return mid;
        }else if(n==v(k,n,w,mid)){
            right=mid;
        }else left =mid+1;
    }
    return 0;
}

int main(){
    int n,k;
    int w[100010];
    int maxw=0;
    cin >> n >> k;
    for(int i=0;i<n;i++){
        scanf("%d",&w[i]);
        maxw=max(maxw,w[i]);
    }
    cout << BinarySearch(k,n,w,maxw) << endl;

    return 0;
}



Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod 			1000000007
#define tc(t) 			int t;cin >> t;while(t--)
#define for0(i , n)		for(int i=0;i<n;i++)
#define loop(i , a, b)	for(int i=a;i<=b;i++)
#define endl 			'\n'
#define inf 			1e18
#define fi 				first
#define se 				second

int XX[8]={+1, +1, +1, 0, 0, -1, -1, -1};
int YY[8]={+1, 0, -1, +1, -1, +1, 0, -1};
int dx[4]={-1,1,0,0};
int dy[4]={0,0,1,-1};


signed main() {

	ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
#ifndef ONLINE_JUDGE
	freopen("input.txt" , "r" , stdin);
	freopen("output.txt" , "w" , stdout);
#endif

	string s;
	cin>>s;

	int sum=0;

	for(int i=0;i<s.size();i++){
		sum+=(s[i]-'0');
	}

	cout<<((sum%9==0)?"Yes":"No");

	return 0;
}

Measured memory_bytes: 3732
#include <bits/stdc++.h>
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18+7)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define mkt make_tuple
#define prique(T) priority_queue<T,vector<T>,greater<T>>
#define vecunique(vec) sort(vec.begin(), vec.end());decltype(vec)::iterator result = std::unique(vec.begin(), vec.end());vec.erase(result, vec.end())
using namespace std;

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x > 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % mod;
		}
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2) % mod;
}
/*--------Library Zone!--------*/

int n, m;
int a[114514], b[114514];
pair<P,int>p[114514];
int num[114514];
string mystoi(int x) {
	string res = to_string(x);
	while (res.size() < 6) {
		res = "0" + res;
	}
	return res;
}
signed main() {
	cin >> n >> m;
	rep(i, m) {
		cin >> a[i] >> b[i];
		p[i] = { {a[i],b[i]},i };
	}
	sort(p, p + m);
	int index = 1;
	rep(i, m) {
		num[p[i].second] = index;
		index++;
		if (p[i].first.first != p[i + 1].first.first)index = 1;
	}
	rep(i, m) {
		cout << mystoi(a[i]) << mystoi(num[i]) << endl;
	}
}

Measured memory_bytes: 6528
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {

            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }






        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);


            var abc = Reads();
            var a = abc[0];
            var b = abc[1];
            var c = abc[2];
            long ans = 0;
            if (a % 2 == 0 && b % 2 == 0 && c % 2 == 0)
            {
                for (long i = 2; i <= (long)Math.Pow(10,9); i*=2)
                {
                    if (a % i == b % i && b % i == c % i) ans++;
                    else break;
                }
            }
            else
            {
                ans = 0;
            }
            long l = 2;
            long count = 0;
            while(l <= (long)Math.Pow(10, 9))
            {
                l *= 2;
                count++;
            }
            
            Console.WriteLine(ans == count ? -1 : ans);
            
           
           
            



            Console.Out.Flush();
        }
    }
}




Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <cstdlib>
#include <cmath>
int main() {
  int N,i,j;
j=0;
double b,c;
c=100000;
b=0.0;
cin>>N;
int a[N];
double D[N];
for(i=0;i<N;i++){
cin>>a[i];
b=b+a[i];
}
b=b/N;
for(i=0;i<N;i++){
D[i]=abs(b-a[i]);
}
for(i=0;i<N;i++){
if(c>D[i]){
c=D[i];
j=i;
}
}
cout<<j<<endl;
}

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

namespace dwacon6th_prelims_a
{
  class Program
  {
    static void Main(string[] args)
    {
      var N = CIn.ReadInt();
      var s = new string[N];
      var t = new int[N];
      for (var i = 0; i < N; i++)
      {
        s[i] = CIn.Read();
        t[i] = CIn.ReadInt();
      }
      var X = CIn.Read();

      var f = false;
      var ans = 0;

      for (var i = 0; i < N; i++)
      {
        if (f) ans += t[i];
        if (s[i] == X) f = true;
      }

      Console.WriteLine(ans);
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }
      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }
      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }
      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }
      return array;
    }

    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];
      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }
      return array;
    }
  }
}


Measured memory_bytes: 11220
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

#define access(i) a[i/3][i%3]

 int main(){

  long long n;
  cin>>n;
  vector<int>a(n);

  for(int i=0;i<n;i++)
    cin>>a[i];

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

 cout<<a[n/2]-a[(n-1)/2]<<endl;

return 0;
 }


Measured memory_bytes: 3716
#include <bits/stdc++.h>
using namespace std;
int main(){
    long n,s1=0,s2=0;
    cin >> n;
    map<long,long> mp;
    vector<pair<long,long>> RecCan;
    for(long i=0;i<n;i++){
        long a;
        cin >> a;
        mp[a]++;
    }
    for(auto i:mp){
        if(2<=i.second) RecCan.push_back(i);
    }
    long r = RecCan.size();
    for(long i=0;i<r;i++){
        if(4<=RecCan.at(i).second) s2 = RecCan.at(i).first*RecCan.at(i).first;
    }
    if(r<2){
        cout << s2 << endl;
        return 0;
    }
    s1 = RecCan.at(r-1).first*RecCan.at(r-2).first;
    cout << max(s1,s2) << endl; 
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define len(x) (int) (x.size())

using namespace std;
// Length of longest common substring ending at ith and jth position
// geeksforgeeks
//     ^       ^   L[5][13] = 5
// L[i][j] = L[i-1][j-1]+1, last nº matches + 1
int LCS[5002][5002];
int res_length = 0;

// Problema: encontre o sufixo de repetição mais longo
// para todos os prefixos na string str.
// Sem overlap: aabaabaaba
//              1234567890
//                 ^  ^
// 7-4 = 3 (letras a esquerda de mys[3])
// LCS[3][6] = 3
// Isto é, iminência de overlap
void long_nrsubst(string mys) {
    memset(LCS, 0, sizeof(LCS));
    for(int i = 1; i <= len(mys); i++) {
        for(int j = i+1; j <= len(mys); j++) {
            if (mys[i-1] == mys[j-1] && LCS[i-1][j-1] < (j-i)) {
                LCS[i][j] = LCS[i-1][j-1]+1;
                res_length = max(LCS[i][j], res_length);
                // Se quiser a string: index = max(i, index);
            }
            else
                LCS[i][j] = 0;
        }
    }
}

int main() {
    int n;
    string s;
    cin >> n >> s;
    
    long_nrsubst(s);
    cout << res_length << '\n';

    return 0;
}

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

using namespace std;

int main (void) {
    int N;
    long long K;
    cin >> N >> K;
    vector<int> A(N);
    for ( int i=0; i<N; i++ ) {
        cin >> A.at(i);
        A.at(i)--; /* 0 index に */
    }

    int cur_city = 0, next_city, loop_start = 0;
    vector<int> visited(N);
    long long start_idx = 0, end_idx = -1;

    if ( K < 200000 ) {
        for ( long long i=0; i<K; i++ ) {
            cur_city = A.at(cur_city);
        }
    }
    else {
        for ( long long i=0; i<K; i++ ) {
            visited.at(cur_city)++;
            next_city = A.at(cur_city);
            /* 今の町が初回で次の町が二回目のときがループの開始 */
            if ( visited.at(cur_city) == 1 && visited.at(next_city) == 1 ) {
                start_idx = i;
                loop_start = cur_city;
            }
            /* 今の町が二回目で次の町が三回目のときループ終了 */
            if ( visited.at(cur_city) == 2 && visited.at(next_city) == 2 ) {
                end_idx = i;
                break;
            }
            cur_city = next_city;
        }
    }

    int ans_city = cur_city;
    if ( end_idx != -1 ) {
        K -= start_idx;
        ans_city = loop_start;
        long long ans_idx = K % (end_idx - start_idx);
        for ( long long i=0; i<ans_idx; i++ ) {
            ans_city = A.at(ans_city);
        }
    }

    cout << ans_city + 1 << endl;

    return 0;
}


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




int main(){
	
	int a,b,m,i,mn=INT_MAX,x,y,c;
	cin>>a>>b>>m;
	int arr[a],brr[b];
	for(i=0;i<a;i++)cin>>arr[i];
	for(i=0;i<b;i++)cin>>brr[i];
	for(i=0;i<m;i++){
		cin>>x>>y>>c;
		mn=min(mn,arr[x-1]+brr[y-1]-c);
	}
	sort(arr,arr+a);
	sort(brr,brr+b);
	mn=min(arr[0]+brr[0],mn);
	cout<<mn;
	return 0;
}

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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
           String s = Console.ReadLine();
           int ints = int.Parse(s);
           TimeSpan ts = new TimeSpan(0, 0, ints);
            
            int hour = ts.Hours;
            int minute = ts.Minutes;
            int second = ts.Seconds;
            Console.WriteLine(hour + ":" + minute + ":" + second);
        }
    }
}


Measured memory_bytes: 15956
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include <random>

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 FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ");
//#define double long double

template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
const int MAX = 200060;
const double pi = acos(-1);
const ll INF = 1e18;



void solve() {
	ll ans = 0;
	int N; cin >> N;
	vector<int>A(N);
	REP(i, N) {
		cin >> A[i];
	}
	REP(i, N - 1) {
		FOR(j, i + 1, N) {
			ans += A[i] * A[j];
		}
	}
	print(ans);
}


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

	solve();
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    int t = 0;
    int k = 0;
    int tmp = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == 'T') tmp++;
        else tmp--;
        t = max(t,tmp);
    }
    if(t < 0) t = 0;

    tmp = 0;
    for(int i = n-1; i >= 0; i--){
        if(s[i] == 'S') tmp++;
        else tmp--;

        k = max(k,tmp);
    }
    if(k < 0){
        k = 0;
    }
    int ans = 0;
    ans = k+t;
    cout << ans << endl;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> num(N);
  rep(i,N){
    cin >> num.at(i);
  }
  sort(num.begin(),num.end());
  reverse(num.begin(),num.end());
  
  double sum=0;
  rep(i,N){
    if (i<N-1) {
      sum += num.at(i)/pow(2,(i+1));
    }
    else{
      sum += num.at(i)/pow(2,(N-1));
    }
  }
    cout << sum << endl;
}



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



int main(){
	ll n;
	cin>>n;
	ll ans=0;
	if(!(n%2)){
		while(1){
			if(n<10)break;
			ll num=n/5;
			ans+=num/2;
			n/=5;
		}
	}
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
s = int(input())
a = set([s])
p = s
n = 0
cnt = 1
while True:
  if n in a:
    print(cnt)
    exit()
  a.add(n)
  if p&1:
    n = 3*p +1
  else:
    n = p//2
  cnt += 1
  p = n


Measured memory_bytes: 2940
#include<stdio.h>
int main()
{
int n;
int i;
int m;
int sum;
int a[101],b[101];
scanf("%d",&n);
for(i=0;i<n-1;i++)
{
scanf("%d",&b[i]);

}
// 
if(n>1)
{
sum=0;
for(i=1;i<n-1;i++)
{
	b[i]>b[i-1]?a[i]=b[i-1]:a[i]=b[i];
	sum+=a[i];
}

a[0]=b[0];
a[n-1]=b[n-2];
sum=sum+a[0]+a[n-1];

}

else
{
sum=b[0];

}


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


Measured memory_bytes: 128
/*
  A - Two Rectangles
  <http://abc052.contest.atcoder.jp/tasks/abc052_a>
*/

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

  int A, B, C, D;

  scanf("%d %d %d %d", &A, &B, &C, &D);
  if( A*B > C*D ){
    printf("%d\n", A*B);
  }else{
    printf("%d\n", C*D);
  }
    
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  int values[n];

  for (int i = 0; i < n; i++) {
    cin >> values[i];
  }

  for (int j = 0; j < n - 1; j++) {
    cout << values[j] << " ";
  }
  cout << values[n - 1] << endl;

  for (int i = 1; i < n; i++) {
    int value = values[i];
    int j = i - 1;
    while (j >= 0 && values[j] > value) {
      values[j + 1] = values[j];
      j--;
    }
    values[j + 1] = value;

    for (int j = 0; j < n - 1; j++) {
      cout << values[j] << " ";
    }
    cout << values[n - 1] << endl;
  }
}



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

int main() {
  int n;
  int a;
  int b;
  cin >> n;
  a = ( n / 10 );
  b = ( n % 1000 );
  if (a % 111 == 0 ) { cout << "Yes" << endl; }
  else if ( b % 111 == 0 ){ cout << "Yes" << endl;}
  else { cout << "No" << endl; }
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"io"
	"math"
	"os"
	"strconv"
)

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	var a, b, c, d []int
	n := nextInt()
	m := nextInt()

	for i := 0; i < n; i++ {
		a = append(a, nextInt())
		b = append(b, nextInt())
	}
	for j := 0; j < m; j++ {
		c = append(c, nextInt())
		d = append(d, nextInt())
	}

	for i := 0; i < n; i++ {
		fmt.Println(calc(a[i], b[i], c, d))
	}
}

func calc(a, b int, c, d []int) int {
	key := 0
	val := math.MaxInt32
	for i := range c {
		tmp := abs(c[i]-a) + abs(d[i]-b)
		if tmp < val {
			key = i + 1
			val = tmp
		}
	}
	return key
}

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

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

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<queue>
#include<bitset>

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

using namespace std;

typedef long long int lli;
typedef vector<int> vi;

int main() {
	vector<string>x;
	string s, t;
	int i, j, k, l, m;

	cin >> s >> k;

	m = s.size();
	
	rep(i, m) {
		l = min(k + i, m);
		t = "";
		for (j = i; j < l; j++) {
			t += s[j];
			x.push_back(t);
		}
	}

	sort(x.begin(), x.end());
	unique(x.begin(), x.end());

	cout << x[k - 1];

	return 0;
}

Measured memory_bytes: 1660
#include"bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
constexpr long long mod = 1000000007;
typedef pair<int, int> P;
int res;
int fib[90];
int fi2[90][90];
int gcd(int a, int b) {
	if (a < b)swap(a, b);
	if (!b)return 0;
	if (a / b > 1&&b>1)res++;
	if (b == 1 && a > 2)res++;
	return 1+gcd(b, a%b);
}

signed main() {
	int q; cin >> q;
	fib[0]=fib[1] = 1;
	rep(i, 88)fib[i+2]=fib[i + 1] + fib[i];
	for(int i=0;i<90;i++) {
		fi2[i][0] = fi2[i][1] = 1;
		for (int j = 1; j <= 88; j++) {
			if (i == j)fi2[i][j + 1] = fi2[i][j] * 2 + fi2[i][j - 1];
			else fi2[i][j + 1] = fi2[i][j] + fi2[i][j - 1];
		}
	}

	//f[87]で10^18を超える
	rep(i, q) {
		int x, y; cin >> x >> y;
		if (x > y)swap(x, y);
		if (P(x, y) == P(1, 1)) {
			puts("1 1"); continue;
		}
		int K = 0;
		rep(i, 88) {
			if (fib[i] <= x&&fib[i + 1] <= y)K = i;
		}

		if (K == 1) {
			cout <<K<<' '<< x*y%mod << endl;
			continue;
		}

		int ans = 0;
		int d = y - fib[K + 1];
		d /= fib[K]; d++;
		ans += d;
		if (x >= fib[K + 1]) {
			d = x - fib[K + 1];
			d /= fib[K]; d++;
			ans += d;
		}

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

			if (fi2[i][K] <= x&&fi2[i][K + 1] <= y) {
				d = y - fi2[i][K + 1];
				d /= fi2[i][K]; d++;
				ans += d;
				ans %= mod;
				if (fi2[i][K + 1] <= x) {
					d = x - fi2[i][K + 1];
					d /= fi2[i][K]; d++;
					ans += d;
					ans %= mod;
				}
			}
		}

		cout <<K<<' '<< ans%mod << endl;
	}
}

Measured memory_bytes: 4096
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <algorithm>
#include <cmath>
#include <iomanip>


int main()
{
    // std::cout << std::fixed << std::setprecision(10);
    int n, m, c;
    std::cin >> n >> m >> c;
    std::vector<int> b(m);
    for(int i=0; i<m; i++) std::cin >> b[i];
    int ans = 0;
    for(int i=0; i<n; i++)
    {
        int temp;
        int cost = c;
        for(int i=0; i<m; i++)
        {
            std::cin >> temp;
            cost += temp * b[i];   
        }
        if(cost > 0) ans++;
    }
    std::cout << ans << std::endl;
    return 0;
}

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

int main() {
	string str;
	cin >> str;
	
	for(unsigned int i = 0; i < str.size(); i++){
		if(str[i] == 'A')
			str[i] = 'X';
		else if(str[i] == 'B')
			str[i] = 'Y';
		else if(str[i] == 'C')
			str[i] = 'Z';
		else
			str[i] = str[i] - 3;
	}
	cout << str << endl;
	return 0;
}

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

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

int main()
{
    int n;
    cin >> n;
    vector<pair<int, int>> a(n);
    rep(i, n) a[i].first = i + 1;
    rep(i, n) cin >> a[i].second;
    sort(a.begin(), a.end(), second_compare);
    for (auto aa : a)
        cout << aa.first << ' ';
    cout << endl;

    return 0;
}

Measured memory_bytes: 1536
from collections import deque

N = int(input())
ab = [[int(i) for i in input().split()] for _ in range(N)]
cd = [[int(i) for i in input().split()] for _ in range(N)]

class FordFulkerson :
    # deque required
    def __init__(self, N) :
        self.N = N
        self.G = [[] for _ in range(N)]
        
    def add_edge(self, fr, to, cap) :
        self.G[fr].append([to, cap, len(self.G[to])])
        self.G[to].append([fr, 0, len(self.G[fr])-1])
        
    def bfs(self, fr, to) :
        self.pre_v = [0] * self.N
        self.pre_e = [0] * self.N
        visited = [False] * self.N
        visited[fr] = True
        
        q = deque([fr])
        while q :
            cur = q.popleft()
            
            for i, (nex, cap, _) in enumerate(self.G[cur]) :
                if visited[nex] or cap <= 0 :
                    continue
                
                self.pre_v[nex], self.pre_e[nex] = cur, i
                q.append(nex)
                visited[nex] = True
                
                if nex == to :
                    return True
                    
        return False
        
    def flow(self, fr, to) :
        ret = 0
        while self.bfs(fr, to) :
            cur = to
            min_cap = float('inf')
            while cur != fr :
                min_cap = min(min_cap, self.G[self.pre_v[cur]][self.pre_e[cur]][1])
                cur = self.pre_v[cur]
                
            ret += min_cap
            cur = to
            while cur != fr :
                self.G[self.pre_v[cur]][self.pre_e[cur]][1] -= min_cap
                self.G[cur][self.G[self.pre_v[cur]][self.pre_e[cur]][2]][1] += min_cap
                cur = self.pre_v[cur]
                
        return ret
        
FF = FordFulkerson(2 * N + 2)
for i in range(N) :
    FF.add_edge(0, i + 1, 1)
    FF.add_edge(i + N + 1, 2 * N + 1, 1)
    
for i, (a, b) in enumerate(ab) :
    for j, (c, d) in enumerate(cd) :
        if a < c and b < d :
            FF.add_edge(i + 1, j + N + 1, 1)

print(FF.flow(0, 2 * N + 1))

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

main(){
    int N, Y;
    cin >> N >> Y;
    bool exist = false;
    int x = 0;
    int y = 0;
    int z = 0;

    for(int i = 0; i <= N; i++){
        for (int j = 0; j <= N; j++){
            z = N - i - j;
            x = i;
            y = j;
            if (z >= 0){
                int total = x * 10000 + y * 5000 + z * 1000;
                if (total == Y){
                    exist = true;
                    break;
                }
            }
        }
        if (exist) break;
    }


    if (exist){
       cout << x << " " << y << " " << z << endl;
    } else {
       cout << "-1 -1 -1" << endl;
    }     
    return 0;
}


Measured memory_bytes: 256
#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, i= 1;
    cin>> n;

    while(i* 1000< n)
        i++;

    cout<< (i* 1000)- n;

    //cout<< (((n+ 1000-1)/ 1000)* 1000) -n;
    nl;


    return 0;
}




Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;

int main() {
    int N, M, a, b, count=0; 
    bool e[9][9]={{0}};
    vector<int> v;
    cin >> N >> M;
    for(int i=0;i<M;i++) {
        cin >> a >> b;
        e[a][b] = 1;
        e[b][a] = 1;
    }
    for(int i=1;i<=N;i++) v.push_back(i);
    do {
        if(v[0]==1){
            for(int i=0; i<v.size()-1; i++) {
                if(e[v[i]][v[i+1]]){
                    if(i==v.size()-2) count++;
                }
                else break;
            }
        }
        //cout << count << endl;
    } while (next_permutation(v.begin(), v.end()));
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vecvec(a,y,x) vector<vector<int>> a(y,vector<int>(x))
#define vec(a,n) vector<int> a(n);rep(i,n)cin>>a[i]

int main(){
  int n;cin>>n;
  vec(b,n-1);
  vector<int> a(n-1);
  a[0]=b[0];
  for(int i=1;i<n-1;i++){
      a[i]=min(b[i-1],b[i]);
  }
  int ans=b[n-2];
  rep(i,n-1) ans+= a[i];
  cout<<ans;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define db(a) cout << fixed << #a << " = " << a << endl;

using namespace std;

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

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

	int N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(all(A), greater<int>());
	ll result = A[0];
	ll c = 1;
	for (int i = 1; i < N - 1; i++) {
		if (c == N - 1) break;
		result += A[i];
		//db(result);
		c++;
		if (c == N - 1) break;
		result += A[i];
		c++;
		//db(result);
	}
	cout << result << endl;
}


Measured memory_bytes: 3992
#include <bits/stdc++.h>
using namespace std;
int main(){
    double X;
    cin >> X;
    double t = 100;
    long long s = 0;
    while(t < X){
        t *= 1.01;
        t = (long long)t;
        s++;
    }
    cout << s << endl;
}

Measured memory_bytes: 3748
#include <bits/stdc++.h>
using namespace std;
// for(long long i = 0;i < num; i++){}
int main() {
    //
    int num, m;
    int befor, after;
    int cnt = 0;

    cin >> num >> m;

    vector<vector<int>> vec(num, vector<int>(2));
    for (int i = 0; i < num; i++) {
        if (i == 0) {
            vec.at(0).at(0) = 1;
            vec.at(0).at(1) = 1;
            continue;
        }
        vec.at(i).at(0) = 1;
        vec.at(i).at(1) = 0;
    }

    for (int i = 0; i < m; i++) {
        cin >> befor >> after;
        befor--;
        after--;

        if (vec.at(befor).at(1) == 1) {
            vec.at(after).at(0)++;
            vec.at(after).at(1) = 1;

            vec.at(befor).at(0)--;
            if (vec.at(befor).at(0) == 0) vec.at(befor).at(1) = 0;
        } else {
            vec.at(after).at(0)++;
            vec.at(befor).at(0)--;
        }
    }

    for (int i = 0; i < num; i++) {
        if (vec.at(i).at(1) == 1) {
            cnt++;
        }
    }

    cout << cnt;
    //
}


Measured memory_bytes: 8808
#include <bits/stdc++.h>
using namespace std;
vector<int> likes(10, 1);
bool isok(int i, vector<int> &likes) {
  while (i) {
    int a = i % 10;
    if (!likes[a]) return false;
    i /= 10;
  }
  return true;
}

int main() {
  int k;
  int n;
  cin >> n >> k;
  vector<int> likes(10, 1);
  for (int i = 0; i < k; i++) {
    int t;
    cin >> t;

    likes[t] = 0;
  }
  // cout << likes[9] << endl;
  // sort(likes.begin(), likes.end());
  int answer = n;
  while (true) {
    if (isok(answer, likes)) {
      cout << answer << endl;
      break;
    }

    else
      answer++;
  }
}

Measured memory_bytes: 3624
MAX_DIGIT = 50
SMALL = 1
EQUAL = 0

N, K = map(int, input().split())
A = list(map(int, input().split()))

dp = [[-1 for _ in range(2)] for _ in range(100)]
dp[0][0] = 0

for d in range(MAX_DIGIT):
    mask = 1 << (MAX_DIGIT - d - 1)
    # A で元々 d 桁目にビットが立っているものの個数
    num = 0
    for i in range(N):
        if A[i] & mask:
            num += 1

    # X の d 桁目を 0, 1 にしたときのコスト
    cost0 = mask * num  # 元々の 1 の個数
    cost1 = mask * (N - num)  # 元々の 0 の個数(反転するから)

    # "K 未満 -> K 未満" の遷移
    if dp[d][SMALL] != -1:
        # 0 でも 1 でも自在に大きい方
        dp[d+1][SMALL] = max(dp[d+1][SMALL], dp[d][SMALL] + max(cost0, cost1))

    # "K ぴったり -> K 未満" の遷移
    if dp[d][0] != -1:
        if K & mask:
            # K の d 桁目が 1 だったら、X の d 桁目は 0 にする
            dp[d+1][SMALL] = max(dp[d+1][SMALL], dp[d][EQUAL] + cost0)

    # "K ぴったり -> K ぴったり" の遷移
    if dp[d][EQUAL] != -1:
        if K & mask:
            dp[d+1][EQUAL] = max(dp[d+1][EQUAL], dp[d][EQUAL] + cost1)
        else:
            dp[d+1][EQUAL] = max(dp[d+1][EQUAL], dp[d][EQUAL] + cost0)


ans = max(dp[MAX_DIGIT][EQUAL], dp[MAX_DIGIT][SMALL])
print(ans)


Measured memory_bytes: 14620
n,k,q = map(int,input().split())
a = [int(input())-1 for i in range(q)]

point = [k for i in range(n)]

for i in range(q):
    point[a[i]] += 1

for i in range(n):
    if point[i] - q > 0:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 58272
n=int(input())
ab=[list(map(int,input().split())) for i in range(n)]

ab.sort(key=lambda x:x[1])

judge=True
time=0

for i in range(n):
        time+=ab[i][0]
        if time>ab[i][1]:
                judge=False
                break

if judge:
        print("Yes")
else:
        print("No")

Measured memory_bytes: 53728
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int d, t, s;
	cin >> d >> t >> s;
	if ((d + s - 1) / s <= t) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N; cin >> N;
	int a[N];
	rep(i, N) cin >> a[i];

	int left = a[0];
	int right = 0;
	rep(i, N - 1) right += a[i + 1];
	int ans = abs(left - right);
	rep(i, N - 2) {
		left += a[i + 1];
		right -= a[i + 1];
		ans = min(ans, abs(left - right));
	}
	cout << ans << endl;


    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
// const int k_mod = 1e9 + 7;
const int k_mod = 998244353;

typedef struct {
	vector <int> to;
} edge;
template <typename T, typename K> struct P {
	T a; K b;
};
int main( void ){
	int N, X, Y; cin >> N >> X >> Y;
	X--;Y--;
	int distance[N] = {};
	rep(i,0,N){
		rep(j,i+1, N){
			distance[min(j-i, abs(X-i)+1+abs(Y-j))]++;
		}
	}
	rep(i,1,N){
		cout << distance[i] << endl;
	}
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


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

int main() {
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  
  if(min(B,D) - max(A,C) > 0){
   cout << min(B,D) - max(A,C) << endl;
  }
  
  if(min(B,D) - max(A,C) < 1){
   cout << 0 << endl;
  }
}


Measured memory_bytes: 256
def resolve():
    #n=int(input())
    #a,b=map(int,input().split())
    #x=list(map(int,input().split()))
    #a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]
    n=int(input())
    MOD=10**9+7
    dp=[[0]*4 for i in range(n+1)]
    dp[0][0]=1
    for i in range(1,n+1):
        dp[i][0]=(dp[i-1][0]*8)%MOD
        dp[i][1]=(dp[i-1][0]+dp[i-1][1]*9)%MOD
        dp[i][2]=(dp[i-1][0]+dp[i-1][2]*9)%MOD
        dp[i][3]=(dp[i-1][1]+dp[i-1][2]+dp[i-1][3]*10)%MOD
    print(dp[n][3])

if __name__ == '__main__':
    resolve()

Measured memory_bytes: 238980
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}


macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    put!(if n%2==0 { n } else { 2 * n });
}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
}


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

int gcd(int m, int n) {
	m = abs(m);
	n = abs(n);
	if (!n) return m;
	return gcd(n, m%n);
}

int main() {
	int N, X;
	int x, now_gcd;

	cin >> N >> X;
	cin >> now_gcd;
	now_gcd = abs(now_gcd - X);
	for (int i = 1; i < N; i++) {
		cin >> x;
		now_gcd = gcd(now_gcd, X - x);
	}

	cout << now_gcd << endl;
}


Measured memory_bytes: 256