akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define lb lower_bound
#define ub upper_bound
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}



signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll n,num=0;cin>>n;
  VV<PL> e(20,V<PL>(0));

  ll cnt=0,msb=0;
  if((1<<19)&n){
    cnt=1<<19;
    msb=19;
  }

  repr(i,0,19){
    if((1<<i)& n){
      chmax(msb,i);
      if(cnt){
        e[0].eb(19-i,cnt);
        ++num;
      }
      cnt+=1<<i;
    }
  }

  rep(i,0,19){
    if(18-i<msb){
      e[i].eb(i+1,1<<(18-i));
      ++num;
    }
    e[i].eb(i+1,0);
    ++num;
  }


  cout<<20<<" "<<num<<ENDL;
  rep(i,0,20)rep(j,0,siz(e[i])){
    cout<<i+1<<" "<<1+e[i][j].fs<<" "<<e[i][j].sc<<ENDL;
  }
}
//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,what to output?

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri(), k = ri();
	int64_t sum[n + 1];
	sum[0] = 0;
	for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + ri() + 1;
	int64_t res = 0;
	for (int i = 0; i <= n - k; i++) {
		res = std::max(res, sum[i + k] - sum[i]);
	}
	printf("%.11f\n", (double) res / 2);
  	return 0;
}


Measured memory_bytes: 1792
#include<stdio.h>
int main(void)
{
  char x[1001],*p;
  int sum;
  for( ; ; )
    {sum=0;
  p=gets(x);
  /*?????????0??????break*/
  if(*p=='0'){break;}
  for( ;*p;p++)
    {
      sum+=(*p-'0');
    }
  printf("%d\n",sum);
    }
  return 0;
}

Measured memory_bytes: 524
#include<bits/stdc++.h>
using namespace std;
#define     debug       printf("\n<<CameHere<<\n")
#define     mem(x,y)    memset(x, y, sizeof(x))
#define     all(qz)     qz.begin(),qz.end()
#define     rall(qz)    qz.rbegin(),qz.rend()
#define     inf         LLONG_MIN
#define     INF         LLONG_MAX
#define     mod         1000000007
#define     Sqr(x)      ((x)*(x))
#define     ll          long long
#define     mk          make_pair
#define     pb          push_back
#define     pi          acos(-1.0)
#define     cos(a)      cos(a*pi/180)
#define     sin(a)      sin(a*pi/180)
#define     tan(a)      tan(a*pi/180)

ll pow(ll c,ll d){return d==0?:c*pow(c,d-1);}
ll gcd(ll a,ll b) {return b==0? a:gcd(b,a%b);}
ll lcm(ll a,ll b) {return ((a*b)/gcd(a,b));}
/*---------AL ASAD NUR RIYAD------------*/


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    char ch;
    cin>>ch;
    if(ch>='A'&&ch<='Z') cout<<"A"<<endl;
    else cout<<"a"<<endl;
    return 0;
}



















Measured memory_bytes: 3648
#include "bits/stdc++.h"
using namespace std;

#ifdef LOCAL
        #include "debug.h"
        #define input freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#else
        #define debug(...) 4
        #define input 4
#endif

using ll = long long;
constexpr int N = 2e5+ 5;
constexpr int mod = 1e9 + 7;

int main() {
    input;
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];

    sort(a, a + n);
    reverse(a, a + n);
    ll ans = 0;
    // a[0], a[1], a[1], a[2], a[2] .. 
    ans += a[0];
    for(int i = 1; i <= (n - 1) / 2; i++) {
        ans += a[i] + a[i];
    }
    if(n % 2)
        ans -= a[(n - 1) / 2];
    cout << ans;
}




Measured memory_bytes: 4440
s = gets.chomp

s.chars.each.with_index(1) do |c, i|
  if i.odd?
    unless %w(R U D).include?(c)
      puts 'No'
      exit
    end
  else
    unless %w(L U D).include?(c)
      puts 'No'
      exit
    end
  end
end
puts 'Yes'

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

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

    static class DEqueue {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            int v[] = new int[n];
            for (int i = 0; i < n; i++) v[i] = in.nextInt();
            int pre[] = new int[n + 1];
            int post[] = new int[n + 1];
            PriorityQueue<Integer> pq = new PriorityQueue<>();
            long ans = 0;
            for (int i = 1; i <= n; i++) pre[i] += pre[i - 1] + v[i - 1];
            for (int i = 1; i <= n; i++) post[i] += post[i - 1] + v[n - i];
            for (int i = 0; i <= n; i++) {
                for (int j = 0; j <= n; j++) {
                    if (i + j <= n && i + j <= k) {
                        int rem = k - i - j;
                        long curr = pre[i] + post[j];
                        ans = Math.max(ans, curr);
                        pq.clear();
                        for (int l = 0; l < i; l++) {
                            if (v[l] < 0)
                                pq.add(v[l]);
                        }
                        for (int l = 0; l < j; l++) {
                            if (v[n - l - 1] < 0)
                                pq.add(v[n - l - 1]);
                        }
                        for (int l = 0; l < rem && pq.size() > 0; l++) {
                            curr += -pq.poll();
                        }
                        ans = Math.max(ans, curr);

                    }
                }
            }
            out.println(ans);
        }

    }

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

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

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

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

    }
}



Measured memory_bytes: 23380
from itertools import permutations

dishes = [int(input()) for _ in range(5)]

minT = 10000
for sample in permutations(dishes, 5):
    t = 0
    for dish in sample:
        if t%10 != 0:
            t += 10 - t%10
        t += dish
    minT = min(minT, t)
print(minT)


Measured memory_bytes: 3060
import sys
def input(): return sys.stdin.readline().rstrip()
class UnionFind():
    def __init__(self, n):
        self.n=n
        self.parents=[-1]*n # 親(uf.find()で経路圧縮して根)の番号。根の場合は-(そのグループの要素数)
    def find(self,x):
        #グループの根を返す
        if self.parents[x]<0:return x
        else:
            self.parents[x]=self.find(self.parents[x])
            return self.parents[x]
    def unite(self,x,y):
        #要素x,yのグループを併合
        x,y=self.find(x),self.find(y)
        if x==y:return
        if self.parents[x]>self.parents[y]:#要素数の大きい方をxに
            x,y=y,x
        self.parents[x]+=self.parents[y]
        self.parents[y]=x #要素数が大きい方に併合
    def size(self,x):
        #xが属するグループの要素数
        return -self.parents[self.find(x)]
    def same(self,x,y):
        #xとyが同じグループ？
        return self.find(x)==self.find(y)
    def members(self,x):
        #xと同じグループに属する要素のリスト
        root=self.find(x)
        return [i for i in range(self.n) if self.find(i)==root]
    def roots(self):
        #全ての根の要素のリスト
        return [i for i, x in enumerate(self.parents) if x<0]
    def all_group_members(self):
        #各ルート要素のグループに含まれる要素のリストの辞書
        return {r: self.members(r) for r in self.roots()}
    def all_group_members_list(self):
        #各ルート要素のグループに含まれる要素のリストのリスト
        #[[0, 2], [1, 3, 4, 5]]
        return list(self.all_group_members().values())
def main():
    n, m = map(int,input().split())
    uf = UnionFind(n)
    for i in range(m):
        a, b = map(int,input().split())
        a -= 1
        b -= 1
        uf.unite(a, b)
    uf_lis = uf.parents
    ans = 0
    for p in uf_lis:
        if p < 0:
            ans = max(ans, -p)
    print(ans)


if __name__=='__main__':
    main()

Measured memory_bytes: 78360
from collections import deque
H, W = map(int, input().split())
INF = float("inf")
d = [[INF] * W for _ in range(H)]
T = [[""] * W for _ in range(H)]
sx, sy = 0, 0
gx, gy = H - 1, W - 1
num = 0
for i in range(H):
    a = input()
    for j in range(W):
        T[i][j] = a[j]
    num += a.count("#")


def bfs():
    que = deque()
    que.append((sx, sy))
    d[sx][sy] = 0

    while len(que):
        x, y = que.popleft()
        if x == gx and y == gy:
            break
        for dx, dy in [(0, 1), (1, 0), (-1, 0), (0, -1)]:
            nx, ny = x + dx, y + dy

            if 0 <= nx < H and 0 <= ny < W and T[nx][ny] != "#" and d[nx][ny] == INF:
                que.append((nx, ny))
                d[nx][ny] = d[x][y] + 1

    return d[gx][gy]


ans = bfs()
if ans < INF:
    print(H * W - ans - num - 1)
else:
    print(-1)


Measured memory_bytes: 3436
import java.util.*;

class Main{
    static int maxN = 300000+5;
    static final long Mod = 998244353;
    static long[] frac = new long[maxN+1];
    static long[] inv = new long[maxN+1];
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        long K = sc.nextLong();
        long[] res = new long[N+1];
        initial();
        for(int a=0;a<=N;a++){
            if(K-(long)a*A==0){
                res[a]=com(N,a);
                continue;
            }
            if((K-(long)a*A)%B!=0) continue;
            long b = (K-(long)a*A)/(long)B;
            if(b<0||b>N) continue;
            res[a]=com(N,a)*com(N,(int)b)%Mod;
        }
        long ans = 0;
        for(int i=0;i<=N;i++) ans = (ans+res[i])%Mod;
        System.out.println(ans);

    }
    static long QucikPower(long a, long pow){
        long ans = 1;
        long base = a;
        while(pow!=0){
            if(pow%2==1) ans = ans*base%Mod;
            base=base*base%Mod;
            pow/=2;
        }
        return ans;
    }
    static void initial(){
        frac[0]=1;
        for(int i=1;i<=maxN;i++) frac[i]=(frac[i-1]*i)%Mod;
        inv[0]=1;
        inv[maxN] = QucikPower(frac[maxN],Mod-2);
        for(int i=maxN-1;i>=1;i--){
            inv[i]=inv[i+1]*(i+1)%Mod;
        }
    }
    static long com(int N, int a){
        return frac[N]*inv[a]%Mod*inv[N-a]%Mod;
    }
}


Measured memory_bytes: 30036
function main(input) {
  var args = input.split(/\s|\n/);
  var amount = args[1] * 1;
  var donuts = [];
  for (var i = 0;i < args[0];i++) {
    donuts[i] = args[i + 2];
    amount -= donuts[i];
  }
  console.log(args[0] * 1 + Math.floor(amount / Math.min(...donuts) * 1));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include <iostream>

using namespace std;

int N;
int A[100000];

int main()
{
    int en = 0;

    cin >> N;

    for (int i = 0; i < N;i++)
    {
        int t;
        cin >> t;
        t--;
        if (A[t] == 1)
        {
            en++;
        }
        else
        {
            A[t] = 1;
        }
    }

    int ans;

    if(en % 2 == 0)
    {
        ans = N - en;
    }
    else
    {
        ans = N - (en + 1);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 768
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>

using namespace std;

void solve()
{
	set<int> s;
	int a, b, c;
	cin >> a >> b >> c;
	s.insert(a);
	s.insert(b);
	s.insert(c);
	cout << s.size() << endl;
}

int main()
{
	solve();
	return(0);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,a,b;
    cin>>n>>a>>b;
    long long f=n%(a+b);
    long long g=n/(a+b);
    g=g*a;
    g=g+min(f,a);
    cout<<g;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
#define FOR(i,a,n) for(ll i=(ll)a;i<(ll)n;i++)
#define RFOR(i,a,n) for(ll i=(ll)n-1;i >= (ll)a;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,0,n)
#define ALL(v) v.begin(), v.end()
#define bra(first,second) '(' << first << ',' << second << ')'
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 4001001001001001001;
long double EPS = 1e-9;
long double PI = 3.141592653589793238;
template<typename T>
void remove(std::vector<T>& vector, unsigned int index){
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

// MOD確認

int main(){
    ll N;
    cin >> N;
    ll ans = 0;
    FOR(i,1,N+1){
        if(i % 3 != 0 && i % 5 != 0) ans += i;
    }
    cout << ans << endl;
}


Measured memory_bytes: 3596
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    static int N;
    static Train[] T;

    public static void main(String[] args) {
        FastScanner fc = new FastScanner(System.in);
        N = fc.nextInt();
        T = new Train[N];
        for (int i = 0; i < N-1; i++) {
            T[i] = new Train(fc.nextInt(), fc.nextInt(), fc.nextInt());
        }

        PrintWriter pw = new PrintWriter(System.out);
        for (int i : solve()) {
            pw.println(i);
        }
        pw.flush();
    }

    static class Train {
        int c, s, f;

        public Train(int c, int s, int f) {
            this.c = c;
            this.s = s;
            this.f = f;
        }

        public int run(int t) {
            if( t <= s ) {
                return s + c;

            } else {
                int q = (t - s) / f;
                int r = (t - s) % f;
                int g = s + (r == 0 ? q*f : (q+1)*f);
                return g + c;
            }
        }
    }

    static int[] solve() {
        int[] ans = new int[N];
        for (int i = 0; i < N-1; i++) {
            ans[i] = calc(i);
        }
        return ans;
    }

    static int calc(int i) {
        int t = 0;
        for (int j = i; j < N-1; j++) {
            t = T[j].run(t);
        }
        return t;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

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

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

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

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

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

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

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


Measured memory_bytes: 23636
#include <string>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
using namespace std;

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

    int minsa = 1000;
    for(int i = 0; i <= s.size() - 3; i++)
    {
        string buf = s.substr(i, 3);
        int num = stoi(buf);
        minsa = min(minsa, abs(num - 753));
    }
    cout << minsa << endl;

}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

typedef pair<int, int> Pi;
typedef tuple<int, int, int> Ti;
typedef vector<int> vint;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

struct UnionFind {
  vector<int> data;
  UnionFind(int n):data(n, -1){}
  int find(int x) {
    if(data[x] < 0) return x;
    else return data[x] = find(data[x]);
  }
  int size(int x) { return -data[find(x)]; }
  bool same(int x, int y) { return find(x) == find(y); }
  void unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return;
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y]; data[y] = x;
  }
};

int lcm(int a, int b) {
  return a / __gcd(a, b) * b;
}

struct SegmentTree {
  vector<int> data;
  vector<int> sum;
  int sz;
  SegmentTree(int n) {
    sz = 1; while(sz < n) sz<<=1;
    resz(data, 2*sz-1, 1);
    resz(sum, 2*sz-1, 0);
  }
  void update(int k, int x, int y) {
    k += sz-1;
    data[k] = x;
    sum[k] = y%mod;
    while(k > 0) {
      k = (k-1)/2;
      data[k] = lcm(data[2*k+1], data[2*k+2]);
      int vl = data[k]/data[2*k+1]%mod*sum[2*k+1]%mod;
      int vr = data[k]/data[2*k+2]%mod*sum[2*k+2]%mod;
      sum[k] = (vl + vr)%mod;
    }
  }
  Pi query(int a, int b, int k, int l, int r) {
    if(r <= a || b <= l) return make_pair(0, 1);
    if(a <= l && r <= b) return make_pair(sum[k], data[k]);
    Pi pl = query(a, b, 2*k+1, l, (l+r)/2);
    Pi pr = query(a, b, 2*k+2, (l+r)/2, r);
    pl.first %= mod;
    pr.first %= mod;
    int LCM = lcm(pl.second, pr.second);
    int vl = LCM/pl.second%mod*pl.first%mod;
    int vr = LCM/pr.second%mod*pr.first%mod;
    int res = (vl + vr)%mod;
    return make_pair(res, LCM);
  }
  Pi query(int a, int b) {
    return query(a, b, 0, 0, sz);
  }
};


signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N, Q;
  cin >> N >> Q;

  vint p(N);
  UnionFind uf(N);
  rep(i, N) {
    cin >> p[i];
    uf.unite(i, p[i]-1);
  }

  vint sum(N);
  rep(i, N) (sum[uf.find(i)] += p[i]) %= mod;

  SegmentTree seg(N);
  rep(i, N) seg.update(i, uf.size(i), sum[uf.find(i)]);

  while(Q--) {
    int l, r;
    cin >> l >> r; --l;
    Pi pi = seg.query(l, r);
    cout << pi.first << endl;
  }

  return 0;
}

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

int main() {
  int N, i;
  string s;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
  cin >> s;
    if (s == "Y") {
      cout << "Four" << endl;
      break;
      }
    else if (i == N-1) {
       cout << "Three" << endl;
    }
  }
}  

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
# define pll pair<ll,ll>

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int x;
    cin>>x;
    
    if(x>=1800){
    	cout<<1;
	}else if(x>=1600){
		cout<<2;
	}else if(x>=1400){
		cout<<3;
	}else if(x>=1200){
		cout<<4;
	}else if(x>=1000){
		cout<<5;
	}else if(x>=800){
		cout<<6;
	}else if(x>=600){
		cout<<7;
	}else if(x>=400){
		cout<<8;
	}
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
	int h,n,a;
	long long cnt=0;
	cin >> h >> n;
	priority_queue <int,vector<int>,less<int> > q;
	for(int i=0;i<h;i++){
		scanf("%d",&a);
        q.push(a);
    }
    if(h>=n){
    	while (n--) 
        	q.pop();
        while (!q.empty()) {
        	cnt+=q.top();
        	q.pop();
    	}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 1400
#include <iostream>

using namespace std;

int main () {

int a,b,c;
  cin>>a>>b>>c;
  if(a!=b and b==c) cout<<"Yes";
  else if (a==b and a!=c) cout<<"Yes";
  else if (a!=b and a==c) cout<<"Yes";
  else cout<<"No";





}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
const ll mod = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
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;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (a < b) {
    ll tmp = a;
    a = b;
    b = tmp;
  }
  ll r = a%b;
  while(r != 0) {
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}

int main() {
  ll n;
  cin >> n;
  deque <ll> d;
  rep(i, n) {
    ll a, b, c;
    cin >> a;
    if (a == 0) {
      cin >> b >> c;
      if (b == 0) {
        d.push_front(c);
      } else {
        d.push_back(c);
      }
    } else if (a == 1) {
      cin >> b;
      cout << d.at(b) << endl;
    } else {
      cin >> b;
      if (b == 0) {
        d.pop_front();
      } else {
        d.pop_back();
      }
    }
  }
}


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

int main() {
  /* code */
  int a,b,c;

  cin >> a >> b >> c;
  if (a < b && b < c) {
    /* code */
    cout <<"Yes"<<'\n';
  }else{
    cout << "No" << '\n';
  }


  return 0;
}



Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */

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

    int N, M; cin >> N >> M;
    vector<vector<int>> to(N);
    rep(i, M){
        int s, t; cin >> s >> t;
        --s; --t;
        to[s].push_back(t);
    }

    vector<double> dp(N, 0.0);
    reprev(i, N-1){
        double now = 0.0;
        for(auto j : to[i]){
            now += dp[j];
        }
        now /= to[i].size();
        now += 1;
        dp[i] = now;
    }

    double ans = dp[0];

    rep(ni, N-1){
        if(to[ni].size() == 1) continue;
        int nj = to[ni][0];
        for(auto j : to[ni]){
            if(dp[j] > dp[nj]) nj = j;
        }

        auto now = [&]{
            vector<double> dp2(N, 0.0);
            reprev(i, N-1){
                double now = 0.0;
                for(auto j : to[i]){
                    if(i == ni && j == nj) continue;
                    now += dp2[j];
                }
                int deg = to[i].size();
                if(i == ni) --deg;
                now /= deg;
                now += 1;
                dp2[i] = now;
            }
            return dp2[0];
        }();

        chmin(ans, now);
    }
    cout << setprecision(15) << ans << endl;
    

    return 0;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 100010
#define INF 10000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
    int n;
    IN(n);
    vector<int>a(n);
    REP(i,n){
        IN(a[i]);
    }
    int cnt=0;
    for(int i=1;i<n-1;i++){
        if((a[i-1]<a[i]&&a[i]<a[i+1])||(a[i-1]>a[i]&&a[i]>a[i+1]))cnt++;
    }
    OUT(cnt);
	return 0;
}

Measured memory_bytes: 256
void main() {
	auto ip = readAs!(ulong[]), Q = ip[0], H = ip[1], S = ip[2], D = ip[3];
	auto N = ri;
	ulong res;
	if(N == 1) res = min(Q*4, H*2, S);
	else {
		res += min(Q*8, H*4, S*2, D) * (N/2);
		if(N % 2 == 1) res += min(Q*4, H*2, S);
	}
	res.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Measured memory_bytes: 256
if __name__ == '__main__':
    [n,k] = [int(i) for i in input().split()]
    a = [int(i)-1 for i in input().split()]
    visit = []
    for i in range(n):
        visit.append(False)
    
    i = 0
    l = []
    pos = -1
    ele = -1
    while True:
        if visit[i] == True:
            ele = i
            break
        visit[i] = True
        l.append(i)
        i = a[i]
    
    pos = l.index(ele)
    period = len(l) - pos
    # print(l)
    # print(pos)
    # print(period)

    if pos == 0:
        print(l[k%period]+1)
        exit()

    ans = -1
    if k < len(l):
        ans = l[k]
    else:
        k -= pos
        pos -= 1
        p = k % period
        p+=1
        ans = l[pos+p]
    print(ans+1)


    
    


Measured memory_bytes: 32352
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>

int main(){
   int N;
   std::cin >> N;
   std::vector<long long int> A(N);
   for (int i=0; i<N; i++){
      std::cin >> A.at(i);
   }
   int index = 0;
   long long int suml = 0;
   long long int sumr = 0;
   long long int suma = std::accumulate(A.begin(), A.end(), 0L);
   long long int min = suma;
   for (int i=0; i<N-1; i++){
      suml = suml + A.at(i);
      sumr = suma - suml;
      long long int d = std::abs(suml - sumr);
      if (d < min){
         min = d;
         index = i;
      }
   }
   std::cout << min << std::endl;

}



Measured memory_bytes: 4844
#include <iostream>
 
int main(int argc, const char * argv[]) {
    int cnt;
    for (int n, x; std::cin >> n >> x && !(n == 0 && x == 0); ) {
        cnt = 0;
        for (int i = 1; i <= n - 2; i++) {
            for (int j = i + 1; j <= n - 1; j++) {
                if ( j + 1 <= x - i - j && x - i - j <= n) {
                    cnt++;
                }
            }
        }
        std::cout << cnt << std::endl;
    }
    return 0;
}

Measured memory_bytes: 3080
#include <map>
#include <cstdio>

using std::map;

int n, m, x, m1, m2;

map <int, int> p;

int main() {
	scanf("%d", &n);
	for(int i = 0;i < n;i ++) {
		scanf("%d", &x);
		p[x] = 1;
	}
	m = p.size();
	m -= !(m & 1);
	printf("%d", m);
	/*
	for(map<int, int>::iterator iter1 = p.begin();iter1 != p.end();iter1 ++)
		m1 ++;
	for(auto iter2 : p) 
		m2 ++;
	if(m1 != m || m2 != m)
		puts("ERROR");
	*/
	return 0;
}

Measured memory_bytes: 4864
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;



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

	int N;
	cin >> N;
	vector<int> T(N);
	int sum = 0;
	REP(i, N) {
		cin >> T[i];
		sum += T[i];
	}
	int M;
	cin >> M;
	REP(i, M) {
		int P, X;
		cin >> P >> X;
		P--;
		cout << sum - T[P] + X << "\n";
	}

	return 0;
}

Measured memory_bytes: 256
// Last Change: 04/20/2019 23:34:33.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

const char black = '#';
const char white = '.';

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

  vector<pair<ll, ll>> ruiseki(N + 1);
  ruiseki[0].first = 0;
  for (ll i = 0, tmp = 0; i < N; ++i) {
    if (S[i] == black) {
      ++tmp;
    }
    ruiseki[i + 1].first = tmp;
  }

  ruiseki[N].second = 0;
  for (ll i = N - 1, tmp = 0; i >= 0; --i) {
    if (S[i] == white) {
      ++tmp;
    }
    ruiseki[i].second = tmp;
  }

  ll ans = INT64_MAX;
  for (ll i = 0; i <= N; ++i) {
    ans = min(ans, ruiseki[i].first + ruiseki[i].second);
  }

  cout << ans << endl;

  //NS::LoopUntilZeroInpput();
}


Measured memory_bytes: 3716
#include <iostream>

using namespace std;

int main() {
    long long int N;
    cin >> N;
    
    if(N>0) {
        long long int cum=1;
        long long int pow=1;
        while(cum<N) {
            pow *= 4;
            cum += pow;
        }

        long long int l=cum-pow, r=cum;
        long long int cur;
        cout << 1;
        bool flag=true;
        while(r-l>1) {
            cur = (r+l)/2;
            if(cur<N) {
                if(flag) {
                    cout << 0;
                    flag=false;
                } else {
                    cout << 1;
                    flag=true;
                }
                l=cur;
            } else {
                if(flag) {
                    cout << 1;
                    flag=false;
                } else {
                    cout << 0;
                    flag=true;
                }
                r=cur;
            }
        }
    } else if (N<0) {
        long long int cum=-2;
        long long int pow=2;
        while(cum>N) {
            pow *= 4;
            cum -= pow;
        }

        long long int l=cum, r=cum+pow;
        long long int cur;
        cout << 1;
        bool flag=true;
        while(r-l>1) {
            cur = (r+l)/2;
            if(cur>N) {
                if(flag) {
                    cout << 0;
                    flag=false;
                } else {
                    cout << 1;
                    flag=true;
                }
                r=cur;
            } else {
                if(flag) {
                    cout << 1;
                    flag=false;
                } else {
                    cout << 0;
                    flag=true;
                }
                l=cur;
            }
        }

    } else {
        cout << 0;
    }
    cout << endl;


    return 0;
    
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<complex>
using namespace std;
int n,a[100010];
vector<int> v;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(i%2==0)v.push_back(a[i]);
	}
	sort(a,a+n);
	sort(v.begin(),v.end());
	long long ans=0;
	for(int i=0;i<v.size();i++){
		int k=lower_bound(a,a+n,v[i])-a;
		if(k%2==1)ans++;
	}cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 1020
s = input().split()

if s[3] == "0" :
    print(0)
    
elif ( int(s[0]) >= int(s[3]) ) :
    print(s[3])

elif ((int(s[3]) - int(s[0]) <= int(s[1]))):
    print(s[0])
elif int(s[3]) - int(s[0]) > int(s[1]) :
    print(int(s[0])- (int(s[3])-int(s[0])-int(s[1])))

Measured memory_bytes: 9216
#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <math.h>
 
using namespace std;
 
typedef long long LL;
typedef long double LD;
typedef string ST;
 
 
#define REP(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define PRINTLN(v) {LL i=0; for(auto (a): v ){   cerr <<i << " : "<<  a << endl; i++;}}
#define PRINTSP(v) for(auto (a): v ) {cerr << a << " ";} cerr << endl
 
 
LL modpow(LL a, LL n, LL mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

LL modinv(LL a, LL m) {
  LL b = m, u = 1, v = 0;
  while (b) {
    LL t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= m;
  if (u < 0){
     u += m;
  }
  return u;
}
void func() {
  LL X ;
  cin >>X;
  LL Y ;
  cin >>Y;
  LL MMM = 1e9+7;
  for(LL i=0;i<=1e6;++i){
    LL XX = X-i*1;
    LL YY = Y-i*2;
    if(XX<0 || YY<0 ){
      continue;
    }
    if(XX==2*YY){
      LL j = YY;
      LL y=1;
      for(LL n=1;n<=i+j;n++){
        y*=n;
        y %= MMM;
      }

      LL x=1;
      for(LL n=1;n<=i;n++){
        x*=n;
        x %= MMM;
      }
      for(LL n=1;n<=j;n++){
        x*=n;
        x %= MMM;
      }

      LL a = modinv(x,MMM);
      LL z = (y*a)%MMM;      
      //cout << i  << endl;
      //cout << j  << endl;
      //cout << y  << endl;
      cout << z  << endl;
      return ;
    }

  }
  cout << 0  << endl;
  return;
  


  
}
 

int main()
{
  func();
  return 0;
}
 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define req(i,n) for(int i = 1;i <=n;i++)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;

//最大公約数
int gcd(int a,int b){
	if (a%b == 0){
		return b;
	}
	else{
		return gcd(b,a%b);
	}

}

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

//素数判定
bool is_prime(long long N) {
    if (N == 1) return false;
    for (long long i = 2; i * i <= N; ++i) {
        if (N % i == 0) return false;
    }
    return true;
}




int main() {
    int N, M; cin >> N >> M;
    vector<long long> X(M);
    for (int i = 0; i < M; ++i) cin >> X[i];
    sort(X.begin(), X.end());
        
    vector<long long> diffs;
    for (int i = 1; i < X.size(); ++i) diffs.push_back(X[i] - X[i-1]);
    sort(diffs.begin(), diffs.end(), greater<long long>());
        
    long long res = X.back() - X[0],ans=0;
    
    for (int i = 0; i < min((int)diffs.size(), N-1); ++i) {
      res -= diffs[i];
      ans += diffs[i];
    }
    cout << res << endl;

}

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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

long long A[100001];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int N;
	long long c=1, ans=1;
	cin>>N;
	for(int i=0;i<=N;i++) cin>>A[i];
	if(N==0) {
		cout<<(A[0]==1 ? 1:-1)<<'\n';
		return 0;
	}
	if(A[N]==0 || A[0]>1 || N>0 && A[0]==1) {
		cout<<"-1\n";
		return 0;
	}
	for(int i=N-1;i>=0;i--) A[i]+=A[i+1];
	for(int i=1;i<N;i++) {
		c=min(2*c,A[i]);
		if(c<A[i]-A[i+1]) {
			cout<<"-1\n";
			return 0;
		}
		ans+=c;
		c-=A[i]-A[i+1];
	}
	cout<<(c<=A[N] && A[N]<=2*c ? ans+A[N]:-1)<<'\n';
	return 0;
}

Measured memory_bytes: 4436
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    cnt=[1]*(N+1)
    
    M=1+(N//2)
    if N%2==1:
        M+=1
    for i in range(1,M):
        temp=2*i
        while temp<=N:
            cnt[temp]+=1
            temp+=i
            
    ans=0
    for i in range(1,N+1):
        ans+=cnt[i]*i
    print(ans)

main()


Measured memory_bytes: 145608
#include <bits/stdc++.h>
using intl = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for(intl i = 0; i < (intl)(n); i++)
#define repd(i, n) for(intl i = (intl)(n); i >= 0; i--)
#define repi(i, a, b) for(intl i = (intl)(a); i < (intl)(b); i++)
#define repid(i, a, b) for(intl i = (intl)(a); i >= (intl)(b); i--)
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define all(x) (x).begin,(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,1,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define alength(a) (sizeof(a) / sizeof(a[0]))
#define cin(i, a) rep(i, alength(a))cin >> a[i]
#define ccin(i, j, a) rep(i, alength(a))rep(j, alength(a[i]))cin >> a[i][j]
#define debug(x) cout << #x << ":" << x << endl
#define rdebug(i,x) rep(i, alength(x))cout << #x << "[" << i << "]:" << x[i] << endl
#define sqrt sqrtl
#define int intl
#define itn intl
#define double ld
#define pb push_back
#define mp make_pair
const intl INF = 1e9;
const intl MOD = 1e9+7;
const ld eps = 1.0e-14;//-9
void fp(bool flag){
    if(flag)cout << "Yes" << endl;
    else cout << "No" << endl;
}
void fp(bool flag, string s, string t){
    if(flag)cout << s << endl;
    else cout << t << endl;
}
intl kai(intl k){
    intl a = 1;
    for(int i = 2; i <= k; i++){
        a *= i;
    }
    return a;
}
intl gcd(intl a, intl b){
    if(!b)return a;
    return gcd(b, a % b);
}
intl digit10(intl a){
    if(!a)return 1;
    intl b = 0;
    while(a){
        a /= 10;
        b++;
    }
    return b;
}
signed main(){
    cout << fixed << setprecision(10);
    intl n;
    cin >> n;
    pair<intl,intl> p[n];
    rep(i,n){
        intl a,b;
        cin >> a >> b;
        p[i] = mp(b,a);
    }
    sort(p, p + n);
    intl time = 0;
    bool flag = true;
    rep(i,n){
        time += p[i].second;
        if(time > p[i].first){
            flag = false;
            break;
        }
    }
    fp(flag);
    return 0;
}

Measured memory_bytes: 3456
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;

int dp[64][2][2][2];
void add(int &a, const int &b) {
	a += b;
	if (a >= MOD)a -= MOD;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int l, r;
	cin >> l >> r;
	string L;
	string R;
	for (int i = 62; i >= 0; i--) {
		L.push_back((l & ((int)1 << i)) ? '1' : '0');
		R.push_back((r & ((int)1 << i)) ? '1' : '0');
	}
	//cerr << L << endl;
	//cerr << R << endl;
	dp[0][0][0][0] = 1;
	for (int i = 0; i < 63; i++) {
		for (int a = 0; a < 2; a++) {
			for (int b = 0; b < 2; b++) {
				for (int x = 0; x < 2; x++) {
					for (int y = 0; y < 2; y++) {
						if (x == 1 && y == 0)continue;
						int na, nb;
						if (a == 1)na = 1;
						else {
							if (L[i] == '1' && x == 0) {
								continue;
							}
							if (L[i] == '0' && x == 1) {
								na = 1;
							}
							else {
								na = 0;
							}

						}
						if (b == 1)nb = 1;
						else {
							if (R[i] == '0' && y == 1) {
								continue;
							}
							if (R[i] == '1' && y == 0) {
								nb = 1;
							}
							else {
								nb = 0;
							}
						}
						if (x == 1 && y == 1) {
							add(dp[i + 1][na][nb][1], dp[i][a][b][0]);
						}
						else if(x == 0 && y == 0){
							add(dp[i + 1][na][nb][0], dp[i][a][b][0]);
						}
						add(dp[i + 1][na][nb][1], dp[i][a][b][1]);
					}
				}
			}
		}
	}

	int res = 0;

	for (int a = 0; a < 2; a++) {
		for (int b = 0; b < 2; b++) {
			add(res, dp[63][a][b][1]);
		}
	}

	cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; 
int main() {
  int A,B,C; cin >>A>>B>>C;
  if(A==B||A==C||B==C){
    if(2*A==(B+C)){
      cout<<"No"<<endl;
    }else{
      cout<<"Yes"<<endl;
    }
  }else{
    cout <<"No"<<endl;
  }
}

Measured memory_bytes: 256
N,M = list(map(int,input().split()))
data = [list(map(int,input().split())) for i in range(N)]
temp = [0]*(N)
temp_ans = 0
ans = -1

for i in range(1<<3):
    temp = [0]*(N)
    temp_ans=0
    for j in range(3):
        if ((i>>j) & 1) == 1:
            for k in range(N):
                temp[k] += (-1) * data[k][j]
        else:
            for k in range(N):
                temp[k] += data[k][j]
    temp.sort(reverse = True)
    for t in range(M):
        temp_ans += temp[t]
    ans = max(ans,temp_ans)
                

print(ans)

Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		long a = sc.nextLong();
		long b = sc.nextLong();

		long mask = 2;
		long result = 0;

		if(a % 2 == 0){
			if((b - a)%4 == 1 || (b - a)%4 == 2){
				result = 1;
			}
			else {
				result = 0;
			}
		}
		else {
			if((b - a)%4 == 0 || (b - a)%4 == 1){
				result = 1;
			}
			else {
				result = 0;
			}
		}
		for(int i = 1; i <= 50; i++){
			long maskedA = a&mask;
			long maskedB = b&mask;
//			System.out.println("i = "+ i+" "+maskedA+" "+maskedB);

			if(maskedA == 0 && maskedB != 0 && b % 2 == 0){
				result += mask;
			}
			else if(maskedA != 0 && maskedB == 0 && a % 2 == 1){
				result += mask;
			}
			else if(maskedA != 0 && maskedB != 0 && a % 2 == b % 2){
				result += mask;
			}

			mask *= 2;
		}

		System.out.println(result);
	}

}


Measured memory_bytes: 25300
#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,k;
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[1500][1500];
bool fl;
struct edge{int to,cost;};
ll black[ohara];
ll b_cou;

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

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];

    int min_cost[h+10][w+10];
	rep(i,h) rep(j,w) min_cost[i][j] = INF;
	queue<pair<ll,ll>> qu; 
    rep(i,h){
        rep(j,w){
             if(s[i][j]=='#')qu.push({i, j}),min_cost[i][j] = 0;
        }
    }
	while(!qu.empty()){
		auto p = qu.front(); qu.pop();
		rep(i,4){
			int nx = p.first + dx[i], ny = p.second + dy[i];
			if(nx<0||ny<0||nx>=h||ny>=w) continue;
            if(s[nx][ny] == '#') continue;
			if(min_cost[p.first][p.second] + 1 >= min_cost[nx][ny]) continue;
			min_cost[nx][ny] = min_cost[p.first][p.second] + 1;
			qu.push({nx, ny});
		}
	}
    rep(i,h){
        rep(j,w){
            //cout<<min_cost[i][j];
            ans=max(ans,(ll)min_cost[i][j]);
        }
        //cout<<"\n";
    }
    Cout(ans);
    return 0;
}


Measured memory_bytes: 23732
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    int N;
    cin>>N;
    vector<int> A(N);
    rep(i,N){
        cin>>A[i];
    }
    sort(all(A));
    int ans=0;
    if(N==1){
        cout << 1 << endl;
        return 0;
    }

    vector<int> count(1000001);
    rep(i,1000001){
        count.push_back(0);
    }
    rep(i,N){
        count[A[i]]++;
    }
    //count⇒その数が数列にいるかいないか

    //A[i]の約数を列挙してsetに詰める
    set<int> div;
    rep(i,N){
        if(count[A[i]]>1){
            continue;
            //同じ数2個以上含まれていれば次に移る
        }
        bool flag=false;
        div.clear();
        rep2(j,1,sqrt(A[i])+1){
            if(A[i]%j==0){
                div.insert(j);
                div.insert(A[i]/j);
            }
        }
        for(auto elm:div){
            if(A[i]!=elm&&count[elm]>0){
                flag=true;
                break;
            }
        }
        if(!flag){
            ans++;
        }

    }
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 11920
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORS(i,a,b) for(int i=a+1;i<=b;i++)
#define REP(i,N) FOR(i,0,N)
#define REPS(i,N) FORS(i,0,N)
#define debug(x) cout<<#x<<"="<<x<<endl
#define debugarr(arr,N,M){REP(i,N){REP(j,M){if(arr[i][j]==INF)printf(" INF");\
	else printf(" %3d",arr[i][j]);} cout<<endl;}}
#define pb push_back
#define pob pop_back
typedef long long ll;
const int INF=100000000;
//--------------------------------------//

int main(){
	int five=0,seven=0;
	REP(i,3){
		int n;
		cin>>n;
		if(n==5) five++;
		else if(n==7) seven++;
	}
	if(five==2&&seven==1) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}


Measured memory_bytes: 256