akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;using ll=int_fast64_t;using ld=long double;using pll=pair<ll,ll>;constexpr ll INF=1LL<<60,MOD=1e9+7;//998244353;
void solve();int main(){cin.tie(nullptr);ios::sync_with_stdio(false);cout<<fixed<<setprecision(10);solve();return 0;}
#define SELECTOR(_1,_2,_3,_4,SELECT,...) SELECT
#define rep(...) SELECTOR(__VA_ARGS__,_rep2,_rep1,_rep0)(__VA_ARGS__)
#define _rep0(i,n) for(ll i=0;i<n;++i)
#define _rep1(i,k,n) for(ll i=k;i<n;++i)
#define _rep2(i,k,n,d) for(ll i=k;d>0?i<n:i>n;i+=d)
#define foreach(a,A) for(auto &a:A)
#define endl "\n"
#ifdef __LOCAL
#include "ostreams.h"
#endif
template<class T> inline bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T &a,const T &b){if(a>b){a=b;return 1;}return 0;}
template<class T> vector<T> make_vector(size_t a,T b){return vector<T>(a,b);}
template<class... Ts> auto make_vector(size_t a,Ts... ts){return vector<decltype(make_vector(ts...))>(a,make_vector(ts...));}
void print(){cerr<<endl;} template<class T,class... Ts> void print(const T& a,const Ts&... ts){cerr<<a<<' ';print(ts...);}

void solve(){
    ll n, m; cin >> n >> m;
    vector<vector<ll>> E(n);
    rep(_, m){
        ll u, v; cin >> u >> v;
        u--; v--;
        E[u].push_back(v);
        E[v].push_back(u);
    }

    auto parent = make_vector(n, -1);
    queue<pll> Q;
    Q.emplace(0, -1);
    while(!Q.empty()){
        ll v, p; tie(v, p) = Q.front(); Q.pop();
        foreach(nv, E[v]){
            if(parent[nv] != -1) continue;
            parent[nv] = v;
            Q.emplace(nv, v);
        }
    }

    cout << "Yes" << endl;
    rep(v, 1, n) cout << parent[v] + 1 << endl;
}

Measured memory_bytes: 13364
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template <size_t I, class H, class... T> struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template <class H, class... T> struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template <class... T> istream& operator>>(istream&i,tuple<T...>& t) { t = TupleReaderWriter<sizeof...(T), T...>::r(i); return i; }
template <class... T> ostream& operator<<(ostream& o, tuple<T...>& t) { string delim = " "; TupleReaderWriter<sizeof...(T) - 1, T...>::w(o, t, delim); return o; }
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using vector2d = vector<vector<T>>;
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    int N;
    cin >> N;
    int X = -1;
    for(int i = 1; i < 1e4; i++) {
        if(N == (i * (i - 1)) / 2) {
            X = i;
        }
    }
    if(X < 0) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    vector<vector<int>> S(X);
    int j = 1;
    for(int n = X - 1; n > 0; n--) {
        for(int i = 0; i < n; i++) {
            S[n].push_back(j);
            S[i].push_back(j);
            j++;
        }
    }
    cout << X << endl;
    for(int i = 0; i < X; i++) {
        cout << S[i].size() << " " << S[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 2304
import java.util.Scanner;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // a
    int limit = sc.nextInt();
    // b
    int container1 = sc.nextInt();
    // c
    int container2 = sc.nextInt();

    int residual = container1 + container2 - limit;
    int result = residual < 0 ? 0 : residual; 
    System.out.print(result);
  }
}

Measured memory_bytes: 21588
///////////////////////////////////////////
// alloy.cpp created 2018-12-22
// Kamil Tokarski

/*       biblioteczka       */
#include <set>
#include <map>
#include <queue>
#include <vector>
#include <string>
#include <iomanip>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;

// types
typedef long long ll;
typedef long double ld;

#define PR  pair
#define PII pair<int, int>
#define PLL pair<ll, ll>

#define VEC vector
#define VL VEC<ll>
#define VI VEC<int>
#define VPI VEC<PII>
#define VPL VEC<PLL>

// IO
#define fastio ios_base::sync_with_stdio(NULL);cout.tie(NULL);cin.tie(NULL)
#define precise(x) cout << fixed << setprecision(x)

#define read_file(var, file) ifstream var(file)
#define write_file(var, file) ofstream var(file)
#define close_file(var) var.close()

// containers
#define sz(x) (int)(x.size())
#define all(x) x.begin(), x.end()
/*          koniec          */


int N;
int H, W;
int A, B;
int answer;


int main(int argc, char **argv) {
  fastio;

  cin >> N >> H >> W;
  for(int i = 0; i < N; ++i) {
    cin >> A >> B; 
    if(A >= H && B >= W) 
      ++answer;
  }

  cout << answer << endl;
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(int i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(ll i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;
const int MOD = 1000000007;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> c(n);
    rep (i, n) {
        cin >> c[i];
        c[i]--;
    }
    vector<int> prev(200000);
    vector<P> sec;
    rep (i, n) {
        if (prev[c[i]] != 0 && prev[c[i]] != i) sec.push_back(make_pair(prev[c[i]], i));
        prev[c[i]] = i + 1;
    }
    sort(all(sec));
    for (P section: sec) eprintf("(%d,%d)", section.first, section.second); eprintf("\n");
    vector<int> ans(n);
    ans[0] = 1;
    int now = 0, nowmax = sec.size();
    repp (i, 1, n) {
        ans[i] = (ans[i] + ans[i - 1]) % MOD;
        if (now != nowmax && sec[now].first == i) {
            ans[sec[now].second] += ans[i - 1];
            now++;
        }
    }
    rep (i, n) eprintf("%d ", ans[i]); eprintf("\n");
    cout << ans[n - 1] << "\n";
    return 0;
}

Measured memory_bytes: 4208
#include <iostream>
#include <vector> 
#include <cmath>
#include <algorithm>
#include <set>
#include <string>
#include <map>
#include <cerrno>
#include <cfenv>
#include <stack>
#include <math.h>
#include <iomanip>
#include <limits>
#include <queue>
#define ll long long int
#define pb push_back
#define mp make_pair

using namespace std;

int main(){

    int a,b;
    cin >> a >> b;
    cout << max(a+b,max(a-b,a*b)) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll a,b,c,i,j,k,l,m,n,ans,tmp,hoge,fuga,piyo;
ll x[10010],y[10010];
string s,str;
int main(){
  cin>>str;
  if(str[0]=='7'||str[1]=='7'||str[2]=='7')cout<<"Yes";
  else cout<<"No";
  return 0;
}

Measured memory_bytes: 3636
import java.util.*;
/*
Main class for AOJ where there is no input.
*/
public class Main{
   public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String str;
      String[] arr;
      int n = Integer.parseInt(sc.nextLine());
      int[][][] status = new int[4][3][10];
      int building;
      int floor;
      int room;
      int v;
      
      
      //initialize "status"
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               status[i][j][k] = 0;
            }
         }
      }
      
      for(int i = 0; i < n; i ++){
         str = sc.nextLine();
         arr = str.split(" ");
         building = Integer.parseInt(arr[0]);
         floor = Integer.parseInt(arr[1]);
         room = Integer.parseInt(arr[2]);
         v = Integer.parseInt(arr[3]);
         
         status[building-1][floor-1][room-1] += v;
      }
      
      for(int i = 0; i < 4; i ++){
         for(int j = 0; j < 3; j++){
            for(int k = 0; k < 10; k ++){
               System.out.print(" " + status[i][j][k]);
            }
            System.out.println();
         }
         if(i < 3) {
            System.out.println("####################");
         }
      }
   
   }//main
}//class

Measured memory_bytes: 27192
#!/usr/bin/env python3
import sys


def solve(S):
    ans = float('inf')
    for i in range(len(S)-2):
        x = abs(753 - int(S[i:i+3]))
        if ans > x:
            ans = x
    print(ans)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: string
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 61860
import sys
for l in sys.stdin:
	s=0
	d=[[100,500,0,0,0,5,1,10,0,50,1000][(n-67)%14]for n in map(ord,l.strip())]
	for i,j in zip(d,d[1:]+[0]):s+=-i if i<j else i
	print s

Measured memory_bytes: 4204
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

class UnionFind:
    """ Union-Find木 """

    def __init__(self, n):
        self.n = n
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n
        self.tree = [True] * n
        self.grpcnt = n

    def find(self, x):
        """ 根の検索(グループ番号の取得) """
        t = []
        while self.par[x] != x:
            t.append(x)
            x = self.par[x]
        for i in t:
            self.par[i] = x
        return self.par[x]

    def union(self, x, y):
        """ 併合 """
        x = self.find(x)
        y = self.find(y)

        if x == y:
            self.tree[x] = False
            return
        if not self.tree[x] or not self.tree[y]:
            self.tree[x] = self.tree[y] = False

        self.grpcnt -= 1
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def is_same(self, x, y):
        """ 同じ集合に属するか判定 """
        return self.find(x) == self.find(y)

    def get_size(self, x=None):
        if x is not None:
            """ あるノードの属する集合のノード数 """
            return self.size[self.find(x)]
        else:
            """ 集合の数 """
            return self.grpcnt
    
    def is_tree(self, x):
        """ 木かどうかの判定 """
        return self.tree[self.find(x)]

N, M = MAP()
A = LIST()
uf = UnionFind(N)
for i in range(M):
    a, b = MAP()
    uf.union(a, b)

L = uf.get_size()
K = (L-1) * 2 
if K > N:
    print('Impossible')
    exit()
elif K == 0:
    print(0)
    exit()

adjli = [[] for i in range(N)]
for i in range(N):
    root = uf.find(i)
    adjli[root].append(A[i])

ans = 0
B = []
for i in range(N):
    if adjli[i]:
        adjli[i].sort(reverse=1)
        ans += adjli[i].pop()
        B += adjli[i]
        K -= 1

B.sort()
ans += sum(B[:K])
print(ans)


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

long long value[51];
long long dp[51][51]; 
void init()
{
	memset(dp,0,sizeof(dp));
	dp[0][0]=1;
	for(int i=1;i<=50;i++)
	{
		dp[i][0]=1;
		for(int j=1;j<=i;j++)
			dp[i][j]=dp[i-1][j-1]+dp[i-1][j];
	}
}
int main()
{
	int N,A,B;
	init();
	while(cin>>N>>A>>B)
	{
		double ave=0;
		for(int i=0;i<N;i++)
			cin>>value[i];
		sort(value,value+N);
		reverse(value,value+N);//大->小
		for(int i=0;i<A;i++) 
			ave+=value[i];
		ave/=A;
		int num=0,k=0;
		for(int i=0;i<N;i++)
		{
			if(value[i]==value[A-1])
			{
				num++;
				if(i<A)
					k++;
			}
		}	
		long long ans=0; 
		if(k==A)//前A个相同,可以增加个数 
		{
			for(int i=A;i<=B;i++)
				ans+=dp[num][i];
		}
		else
			ans+=dp[num][k];

 		printf("%.15f\n",ave);
 		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
N,K= map(int,input().split())
A = list(map(int,input().split()))

#N = 200000
#A = [0]*N
#K = N

for i in range(K):
    diff = [0] * (N+2)
    for n, a in enumerate(A):
        n += 1
        l = max(1,n-a)
        r = min(N+1,n+a+1)
        diff[l] += 1
        diff[r] -= 1
    B = [0]
    for d in diff:
        B.append(B[-1] + d)
    A = B[2:-1]
    if sum(A) == N * N:
        break

print(*A)
        




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

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

template<class T> ll LevenshteinDistance(std::vector<T> v1, std::vector<T> v2){
    std::vector<std::vector<ll>> mat(2, std::vector<ll>(v2.size()+1));
    REP(i,v2.size()+1) mat[0][i]=i;
    REP(i,v1.size()){
        int nextvec = 1-i%2;
        mat[nextvec][0] = i+1;
        REP(j,v2.size()){
            mat[nextvec][j+1] = std::min(std::min(mat[nextvec][j]+1, mat[1-nextvec][j+1]+1), mat[1-nextvec][j]+(v1[i]!=v2[j]));
        }
    }
    return mat[v1.size()%2][v2.size()];
}

int main(){
    std::string s1,s2;
    vector<char> v1,v2; v1.clear(); v2.clear();
    cin>>s1>>s2;
    for(auto i : s1)v1.push_back(i);
    for(auto i : s2)v2.push_back(i);
    cout << LevenshteinDistance(v1,v2) << endl;
    return 0;
}


Measured memory_bytes: 3252
#!/usr/bin/env python3
import sys


def solve(A: int, V: int, B: int, W: int, T: int):
    if V-W <= 0:
        print("NO")
    elif abs(A-B) > (V-W) * T:
        print("NO")
    else:
        print("YES")
    return 0

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    V = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    solve(A, V, B, W, T)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9080
using System;

namespace ITP1_2_B
{
    class Program
    {
        static void Main(string[] args)
        {
            string [] input = System.Console.ReadLine().Split(' ');
            int a = Int32.Parse(input[0]);
            int b = Int32.Parse(input[1]);
            int c = Int32.Parse(input[2]);
            if (a < b && b < c)
            {
                System.Console.WriteLine("Yes");
            } else
            {
                System.Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 8876
#include<stdio.h>
#include<stdlib.h>
int top=0;//指向最后一个元素
int S[1000];
void push(int x)
{
    top++;
    S[top]=x;
}
int pop()
{
    top--;
    return S[top+1];
}
int main()
{
    char s[100];
    while(scanf("%s",s)!=EOF)//空格截止
    {
        if(s[0]=='+')
        {
            int a=pop();
            int b=pop();
            push(a+b);
        }
        else if(s[0]=='-')
        {
            int b=pop();
            int a=pop();
            push(a-b);
        }
        else if(s[0]=='*')
        {
            int a=pop();
            int b=pop();
            push(a*b);
        }
        else
        {
            push(atoi(s));
        }
    }
    printf("%d\n",pop());
    return 0;
}



Measured memory_bytes: 2064
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n); i >= 0; i--)
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

const int INF = 2100100100;
const int MOD = 1e9 + 7;

// 多次元 vector 生成
template <class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template <class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

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

    int N;
    cin >> N;

    if (N == 3 || N == 5 || N == 7) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }

    return 0;
}


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


int main()
{
    string s;
    cin>>s;
    if(s=="ABC")
    {
        cout<<"ARC"<<endl;
    }
    else
    {
        cout<<"ABC"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3620
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int[] A;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        A = new int[N];
        for (int i=0; i<N; i++) {
        	A[i] = sc.nextInt();
        }
    }
    
    //解答処理
    private int solve() {
    	int answer = 0;
    	Arrays.sort(A);
        int count = 0;
        int s = A[0];	//基準値
        for (int i=0; i<N; i++) {
        	if (A[i] == s) { //値が存在していたら1増やす
        		count++;
        	} else {
        		s = A[i];
        		if (count%2 == 1) {
        			answer++;
        		}
        		count = 1;
        	}
        }
        if (count%2 == 1) {
        	answer++;
        }
        
        return answer;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

}


Measured memory_bytes: 58868
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = ReadInt();
            var lists = new List<int>();
            var a = 0;
            for (int i = 0; i < n; i++)
            {
                var s = ReadInt();
                if (s % 10 == 0) a++;
                lists.Add(s);
            }
            lists.Sort();

            if (a == lists.Count)
            {
                WriteLine(0);
                return;
            }
            while (true)
            {
                if (lists.Sum() % 10 == 0)
                {
                    for (int i = 0; i < lists.Count; i++)
                    {
                        if(lists[i]%10!=0)
                        {
                            lists.RemoveAt(i);
                            break;
                        }
                    }
                }
                WriteLine(lists.Sum());
                break;
                
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        //最大公約数

        public static int Gcd(int a, int b)
        {
            if (a < b)
            {
                return Gcd(b, a);
            }
            while (b != 0)
            {
                var reminder = a % b;
                a = b;
                b = reminder;
            }
            return a;
        }

        //最小公倍数
        public static int Lcm(int a, int b)
        {
            return a * b / Gcd(a, b);
        }

        //文字数を数える
        public static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }
    }
}


Measured memory_bytes: 13268
function main(input){
  var arr=input.split("");
  var hantei="Good";
  for(var i=0; i<4; i++){
    if(arr[i]==arr[i+1]){
      hantei="Bad"
    }
  }
  console.log(hantei);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using ld = long double;
const int INF = (1<<30)-1;
const long long LINF = (1LL<<62)-1;
const long double PI = acos(-1.0L);
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
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; }

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  char c;
  cin >> c;
  if (c == 'A')
    cout << 'T' << endl;
  if (c == 'T')
    cout << 'A' << endl;
  if (c == 'G')
    cout << 'C' << endl;
  if (c == 'C')
    cout << 'G' << endl;
  return 0;
}

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

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

using ll = long long;
using P = pair<int, int>;

int main(int, char**)
{
    int n;
    cin >> n;

    vector<int> a(n), b(n);
    rep(i,n) cin >> a[i] >> b[i];

    sort(a.begin(), a.end());
    sort(b.begin(), b.end(),greater<int>());

    int ans;
    if (n % 2 != 0) {
        ans = b[n/2] - a[n/2] + 1;
    } else {
        ans = (b[n/2-1] + b[n/2]) - (a[n/2-1] + a[n/2]) + 1;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 4752
function main()
  n,m=parse.(Int,split(readline()))
  h=parse.(Int,split(readline()))
  ans=[1 for i=1:n]
  for i=1:m
    a,b=parse.(Int,split(readline()))
    if h[a]==h[b]
      ans[a]=0
      ans[b]=0
    elseif h[a]<h[b]
      ans[a]=0
    else
      ans[b]=0
    end
  end
  print(sum(ans))
end
main()

Measured memory_bytes: 204820
import copy

n,x = map(int, input().split())
a = list(map(int, input().split()))
ans = sum(a)
now = a.copy()
for i in range(1,n):
  for j in range(n):
    now[j] = min(now[j],a[(j+i)%n])
  ans = min(ans,sum(now) + x * i)
print(ans)

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

#define ll long long
#define rep(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

#define fi first
#define se second
#define all(A) A.begin(),A.end()

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(1e9+7)

ll moddiv(ll a,ll b){
    a %= MOD;
    b %= MOD;
    for(ll m=MOD-2;m>0;m/=2){
        if(m&1){
            a=a*b%MOD;
        }
        b=b*b%MOD;
    }
    return a;
}


ll Fa[2222];

ll C(ll a,ll b){
    return moddiv(Fa[a], Fa[a - b] * Fa[b]);
}

ll S;
ll i, j, k;
ll dp[2222][2222];
ll ans;
int main(){
    scanf("%lld", &S);
    Fa[0] = 1;
    rep(i,0,2020){
        Fa[i + 1] = Fa[i] * (i + 1) % MOD;
    }
    rep(i,1,S){
        ll s = S-i * 3;
        if(s<0)
            break;
        (ans += C(s + i - 1, i - 1)) %= MOD;
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 3844
import java.util.*;


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

		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		if(c-(a-b)<=0){
			System.out.println(0);
		}else{
			System.out.println(c-(a-b));
		}


	}
}


Measured memory_bytes: 21844
#include<stdio.h>
int main()
{
	int a,b=0,i;
	scanf("%d",&a);
	char x[a];
	scanf("%s",x);
	for(i=0;i<a;i++){
		if(x[i]=='A'&&x[i+1]=='B'&&x[i+2]=='C'){
			b++;
		}
	}
	printf("%d\n",b);
	return 0;
}

Measured memory_bytes: 1708
#include <bits/stdc++.h>
using namespace std;
using ll = long long ;
int main(){
ll n ;
cin >> n ;
int a[n] ;
for(int i=0 ; i< n ; i++)
{
    cin >> a[i] ;
}
ll s=0 ,cont=0 ;
for(int i=0 ; i< n ; i++)
{
   if(a[i]>=s)
   {
       cont++ ;
       s=a[i] ;
   }
}
cout << cont <<endl ;



 return 0  ;
}



Measured memory_bytes: 256
n,w = map(int,input().split())
w_i = [0]
v_i = [0]
for i in range(n):
  temp = list(map(int,input().split()))
  w_i.append(temp[0])
  v_i.append(temp[1])

dp = []
for i in range(n+1):
  temp = []
  for j in range(w+1):
    temp.append(0)
  
  dp.append(temp)

for i in range(1,n+1):
#  print(dp)
  for j in range(w+1):
    temp_1 = -float("inf")
    if j-w_i[i] >= 0:
      temp_1 = dp[i-1][j-w_i[i]] + v_i[i]
    
    temp_2 = dp[i-1][j]
    
    if temp_1 <= temp_2:
      dp[i][j] = temp_2
    elif temp_2 < temp_1:
      dp[i][j] = temp_1
      
print(dp[n][w])

Measured memory_bytes: 144728
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
lines = defaultdict(set)
ABs = []
for _ in range(N-1):
    a,b = inpl()
    a,b = a-1, b-1
    ABs.append((a,b))
    lines[a].add(b)
    lines[b].add(a)


K = -1
ki = -1
for i in range(N):
    if K < len(lines[i]):
        K = len(lines[i])
        ki = i



colors = [defaultdict(int) for _ in range(N)]

def dfs(s,bs,bk):
    cnt = 0
    for t in lines[s]:
        if t == bs:
            continue
        else:
            if cnt == bk:
                cnt += 1
            colors[s][t] = cnt
            colors[t][s] = cnt
            dfs(t,s,cnt)
            cnt += 1


for i,t in enumerate(lines[ki]):
    colors[ki][t] = i
    colors[t][ki] = i
    dfs(t,ki,i)

print(K)
for a,b in ABs:
    print(colors[a][b]+1)


Measured memory_bytes: 98796
mod = 10**9+7
n = gets.to_s.to_i

a = []
b = []
c = []
genten_iwashi = 0

n.times do 
  x, y = gets.to_s.split.map{|e|e.to_i}
  
  if x == 0 && y == 0
    genten_iwashi += 1
    next
  end
  
  g = x.gcd(y)
  if y < 0
    x *= -1
    y *= -1
  end
  a << x.abs / g
  b << y.abs / g
  if x== 0 || y == 0
    c << 0
  else
    c << x / x.abs * y / y.abs
  end
end

# A_{i} / B_{i} = -B_{j} / A_{j}
# L_{i} = R{i}
left  = a.size.times.map{|i| [ a[i], b[i],  c[i]] }.tally
right = a.size.times.map{|i| [ b[i], a[i], -c[i]] }.tally

left.default = 0
right.default = 0

class Array
  def musubu
    [self[1], self[0], -self[2]]
  end
end

ans = 2.pow(n, mod) - 1

cnt = []

used = Hash.new(false)

normal = nakayoi = a.size
# ans = 2.pow(normal, mod)
left.keys.each do |d|
  
  t = left[d] * right[d]
  if (t > 0 && !used[d] && !used[d.musubu])
    tmp = 2.pow(left[d], mod) + 2.pow(right[d], mod) - 1
    cnt << tmp
    a = left[d]
    b = right[d]
    nakayoi -= a + b
    
  end
  used[d] = used[d.musubu] = true
end

ans = cnt.reduce(2.pow(nakayoi,mod)){|s, t| s * t % mod }

puts (ans +  genten_iwashi - 1) % mod


Measured memory_bytes: 78756
N = int(input())
current = 0
ans = "No"
for _ in range(N):
  d1, d2 = map(int, input().split())
  if d1 == d2:
    current = current + 1
  else:
    current = 0
  if current >= 3:
    ans = "Yes"
    break
print(ans)

Measured memory_bytes: 62352
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define print(x) cout << (x) << endl;
#define printv(x) for(int i = 0; i < x.size(); i++){ cout << (x[i]) << " "; } cout << endl; 
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define INF (1e9)
typedef long long ll;
typedef struct{
    int x;
    int y;
} P;

using namespace std;
ll a_tmp[310][310] = {};
ll b_tmp[310][310] = {};
ll A[310][310] = {};
int N;
void floyd(){
    rep(k,0,N){
        rep(i,0,N){
            rep(j,0,N){
                a_tmp[i][j] = min(a_tmp[i][j], a_tmp[i][k] + a_tmp[k][j]);
            }
        }
    }
}
void floyd2(){
    rep(k,0,N){
        rep(i,0,N){
            rep(j,0,N){
                if(A[i][j] == A[i][k] + A[k][j] && i != j && j != k && k != i){
                    b_tmp[i][j] = 1;
                }
            }
        }
    }
    
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    rep(i,0,N){
        rep(j,0,N){
            cin >> A[i][j];
        }
    }
    rep(i,0,N){
        rep(j,0,N){
            a_tmp[i][j] = A[i][j];
        }
    }
    floyd();
    bool flg = true;
    rep(i,0,N){
        rep(j,0,N){
            if(A[i][j] != a_tmp[i][j]){
                flg = false;
            }
        }
    }
    if(!flg){
        print("-1");
        return 0;
    }
    floyd2();
    ll ans = 0;
    rep(i,0,N){
        rep(j,0,N){
            if(b_tmp[i][j] == 0){
                ans += A[i][j];
            }
        }
    }
    ans /= 2;
    print(ans);



}


Measured memory_bytes: 2432
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    N, M = Scanner.map_int()
    S = Scanner.string()
    pos = N
    ans = []
    while pos > 0:
        for i in range(max(pos - M, 0), pos):
            if S[i] == '0':
                ans.append(pos - i)
                pos = i
                break
        else:
            print(-1)
            return
    print(*ans[::-1])


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 12900
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define F first
#define S second
#define pb push_back
#define mp make_pair

const int MOD = 1000000007;
const int N = 1e5 + 18;



int32_t main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
    int t = 1;
    //cin >> t;
    while (t--) {

        int n; cin >> n;
        int ans;
        for (int i = 1; i < 12; i++) {
            ans = 1000 * i - n;
            if (ans >= 0)break;
        }
        cout << ans << endl;
    }
    return 0;

}



Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
	
  	if(abs(a-c) <= d || (abs(a-b) <=d && abs(c-b) <= d))
      cout << "Yes" << endl;
  	else
      cout << "No" << endl;


    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main()
{
long long int n, x;
cin >> x >> n;
long long int i;
map<long long int, long long int>m;
long long int a[n];
for(i=0;i<n;i++)
{
cin >> a[i];
m[a[i]]++;
}
long long int broj, mini = 1000;
for(i=-1000;i<=1000;i++)
{
 if(abs(i-x) < mini && m[i] == 0)
 {
 	mini = abs(i-x);
 	broj = i;
 }
}
cout << broj << endl;
	return 0;
}

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

vector<int> v(5);
int minimum = 10;
int ans = -10;
bool good = true;

int main() {
  rep (i, 5) {
    cin >> v.at(i);
    if (v.at(i) % 10 != 0) {
      good = false;
      minimum = min(minimum, v.at(i) % 10);
    }
    ans += ((v.at(i)-1) / 10) * 10 + 10;
  }
  ans += minimum;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;

/**
 * Dijkstra's algorithm.
 * First, call add_edge() to add edges.
 * Second, call solve() to calculate the length of the shortest path from source to each vertex.
 * Header requirement: algorithm, queue, vector
 * Verified by AtCoder ARC026-C (http://arc026.contest.atcoder.jp/submissions/604231)
 */
 template<class Len = int>
class Dijkstra {
private:
  int n;
  std::vector<std::vector<std::pair<int, Len> > > edges;
public:
  /**
   * n: the number of vertices
   */
  Dijkstra(int n) : n(n), edges(n) {}
  /*
   * from: the source of edge to add
   * to: the target of edge to add
   * cost: the cost of edge to add
   */
  void add_edge(int from, int to, Len cost) {
    edges[from].push_back(std::pair<int, Len>(to, cost));
  }
  /*
   * This function returns an array consisting of the distances from vertex source.
   */
  std::vector<Len> solve(int source) {
    const Len inf = 1e16;
    typedef std::pair<Len, int> pi;
    std::vector<Len> d(n, inf);
    std::priority_queue<pi, std::vector<pi>, std::greater<pi> > que;
    que.push(pi(0, source));
    while (!que.empty()) {
      pi p = que.top(); que.pop();
      int idx = p.second;
      if (d[idx] <= p.first) {
	continue;
      }
      d[idx] = p.first;
      for(int j = 0; j < edges[idx].size(); ++j) {
	que.push(pi(p.first + edges[idx][j].second, edges[idx][j].first));
      }
    }
    return d;
  }
};

map<PI, int> reg;
vector<PI> reg_v;
vector<vector<PI> > edges;
int regi(PI p) {
  if (reg.count(p)) {
    return reg[p];
  }
  int s = reg_v.size();
  reg_v.push_back(p);
  edges.push_back(vector<PI>());
  reg[p] = s;
  return s;
}

int main(void){
  int n, m;
  cin >> n >> m;
  REP(i, 0, m) {
    int p, q, c;
    cin >> p >> q >> c;
    p--, q--, c--;
    int idx1 = regi(PI(p, c));
    int idx2 = regi(PI(q, c));
    edges[idx1].push_back(PI(idx2, 0));
    edges[idx2].push_back(PI(idx1, 0));
    int bot1 = regi(PI(p, -1));
    int bot2 = regi(PI(q, -1));
    edges[bot1].push_back(PI(idx2, 1));
    edges[idx1].push_back(PI(bot1, 0));
    edges[bot2].push_back(PI(idx1, 1));
    edges[idx2].push_back(PI(bot2, 0));
  }
  int st = regi(PI(0, -1));
  int en = regi(PI(n - 1, -1));
  Dijkstra<ll> dijk(reg_v.size());
  REP(i, 0, reg_v.size()) {
    REP(j, 0, edges[i].size()) {
      PI p = edges[i][j];
      dijk.add_edge(i, p.first, p.second);
    }
  }
  ll res = dijk.solve(st)[en];
  cout << (res == 1e16 ? -1 : res) << endl;
}


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

int main(){

    string s,t;
  
  cin >> s >> t;
  
  int n = 0;
  for(int i = 0; i < 3;i++){
    if(s[i] == t[i]) n ++;
  } 
  
  cout << n ;
    return 0;
}


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

#define PI 3.1415926535897932
#define MOD 1000000007
#define INF 1e9

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO  cout << "NO"  << endl
#define No  cout << "No"  << endl

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;


void solve()
{
    int N; cin >> N;
    vi L(N); REP(i, N) cin >> L[i];
    sort(ALL(L));
    int sum = 0; REP(i, N-1) sum += L[i];
    if(L[N-1] < sum) Yes;
    else No;
}
    
int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}

Measured memory_bytes: 256
### constant

MAX_X = MAX_Y = 20
DXYS = { 'N' => [0, 1], 'E' => [1, 0], 'S' => [0, -1], 'W' => [-1, 0] }

### main

loop do
  n = gets.to_i
  break if n == 0

  gems = Array.new(MAX_Y + 1){Array.new(MAX_X + 1){false}}

  n.times do
    x, y = gets.split.map(&:to_i)
    gems[y][x] = true
  end

  count = 0
  x = y = 10
  if gems[y][x]
    count += 1
    gems[y][x] = false
  end

  m = gets.to_i
  
  m.times do
    dr, dist = gets.strip.split
    dist = dist.to_i
    dx, dy = DXYS[dr]
    for i in (1..dist)
      x += dx
      y += dy
      if gems[y][x]
        count += 1
        gems[y][x] = false
      end
    end
  end

  puts (count == n) ? "Yes" : "No"
end

Measured memory_bytes: 6132
h, w = (int(i) for i in input().split())
e = [input() for i in range(h)]

flg = True
for j in range(h):
    for i in range(w):
        if e[j][i] == ".":
            continue
        if i != 0 and e[j][i-1] == "#":
            continue
        if j != 0 and e[j-1][i] == "#":
            continue
        if i != w-1 and e[j][i+1] == "#":
            continue
        if j != h-1 and e[j+1][i] == "#":
            continue
        flg = False
        break

    if not flg:
        break

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

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int n, h[N], mem[N];

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

	cin >> n;

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

	mem[n - 2] = abs(h[n - 1] - h[n - 2]);

	for (int i = n - 3; i >= 0; i--) {
		int a1 = mem[i + 1] + abs(h[i] - h[i + 1]);
		int a2 = mem[i + 2] + abs(h[i] - h[i + 2]);
		mem[i] = min(a1, a2);
	}

	cout << mem[0] << '\n';
	
	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+5;
const int inf = 0x3f3f3f3f;
int a[MAXN];
int dp[MAXN];
int main()
{
	int n;
	cin >> n;
	int maxlen = -1*inf ,len = 0;
	int t = inf;
	for(int i = 1;i <= n;i++){
		scanf("%d",&a[i]);
		if(a[i] <= t){
			t = a[i];
			len++;
			if(len > maxlen) maxlen = len;
		}
		else{
			t = a[i]; 
			len = 1;
		}
	}
	cout << maxlen- 1 << endl;
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
const int INF=0x3f3f3f3f;
string in;
void solve(int T){
	int ans=0;
	cin>>in;
	for(int i=0;i<in.size();i++){
		ans+=(in[i]-'0');
		ans%=9;
	}
	if(ans)puts("No");
	else puts("Yes");
}
signed main(){
	int t=1;
	//scanf("%d",&t);
	for(int i=1;i<=t;i++){
		solve(i);
	}
}

Measured memory_bytes: 3716
# -*- coding: utf-8 -*-

def partition(A, p, r):
    x = A[r]
    i = p-1
    for j in range(p, r):
        if A[j] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i+1], A[r] = A[r], A[i+1]
    return i+1

n = int(raw_input())
A = map(int, raw_input().split())
q = partition(A, 0, n-1)
print " ".join(map(str, A[:q])) + " [%d] " %(A[q]) + " ".join(map(str, A[q+1:]))

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

int main(){
  int n;
  cin >> n;
  if( n == 1 ) cout << 1 << endl;
  else if( 2 <= n && n < 4 ) cout << 2 << endl;
  else if ( 4 <= n && n < 8 ) cout << 4 << endl;
  else if ( n >= 8 && n < 16 ) cout << 8 << endl;
  else if ( n >= 16 && n < 32 ) cout << 16 << endl;
  else if ( n >= 32 && n < 64  ) cout << 32 << endl;
  else if ( n >= 64 ) cout << 64 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) int(x.size())
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    int a,b; string s;
    cin>>a>>b>>s;
    rep(i,0,a+b+1){
        if(i==a&&s[i]!='-'){
            cout<<"No"<<endl;
            return 0;
        }
        else if(i!=a && s[i]=='-'){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int D, T, S;
  cin>>D>>T>>S;
  if(S*T>=D) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}



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

int bit[200005];
void add(int i, int x){
  i++;
  while(i<200005){
    bit[i]+=x;
    i+=i&-i;
  }
}
int sum(int i){
  i++;
  int ret=0;
  while(i){
    ret+=bit[i];
    i-=i&-i;
  }
  return ret;
}

int main(){
  int n, q;
  scanf("%d%d", &n, &q);
  for(int i=0; i<q; i++){
    int t, x, y;
    scanf("%d%d%d", &t, &x, &y);
    if(t) printf("%d\n", sum(y)-sum(x-1));
    else add(x, y);
  }
}

Measured memory_bytes: 3548
// Contest.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include"iostream"
#include"string"
#include"vector"

using namespace std;

int main()
{
	int H;
	int W;
	int h;
	int w;
	cin >> H >> W >> h >> w;
	cout << H * W - (h*W + w * H - h * w) << endl;


	return 0;
}




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

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

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

ll f(ll x,int c,int d){
  ll res = x;
  res -=x/c;
  res -=x/d;
  res +=x/lcm(c,d);
  return res;
}

int main(){
  ll a,b;
  int c,d;
  cin >> a >> b >> c >>d;
  ll ans=f(b,c,d)-f(a-1,c,d);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <math.h>
#include <cstdlib>
#include <cctype>
#include <random>

using namespace std;

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

    int m_left=0, m_right=100001;
    for (int i=0; i<m; i++) {
        cin >> l >> r;
        m_left = max(m_left, l);
        m_right = min(m_right, r);

        //cout << "l:r => " << m_left << " " << m_right << endl;
    }
    if(m_left <= m_right) cout << m_right - m_left + 1 << endl;
    else cout << 0 << endl;


    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <math.h>


int main(){
	
	double i,j,N,A,B,H,M;
	
	double theta_a,theta_b;
	
	scanf("%lf %lf %lf %lf",&A,&B,&H,&M);

	theta_a = 360/12.*H+30./60.*M;//(360/12 deg / hour)  60
	theta_b = 360/60.*M;//(360/60 deg/min)
	double sa = fabs(theta_a-theta_b);
	if(sa>180) sa = 360 -sa;
	//printf("sa:%lf deg/ %lf %lf\n",sa,theta_a,theta_b);
	double ans;
	
	ans = sqrt(A*A+B*B-2*A*B*cos(sa/180.*M_PI));

	printf("%.12lf\n",ans);
		
	return 0;
}


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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> VECLL;
typedef vector<P> VECP;
typedef priority_queue<P,VECP,greater<P> > PQP;
typedef priority_queue<ll, VECLL, greater<ll> > PQll;

#define rep(i,a,n) for(ll i = a;i < n;i++)   
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

const ll MOD = 1e9+7;

int main(){
    ll n,cnt = 0;
    cin >> n;
    ll a[n] = {};

    rep(i,0,n) cin >> a[i];

    rep(i,0,n){
        P tmp = P(LINF,-1);
        rep(j,i,n){
            if(tmp.first > a[j]){
                tmp = P(a[j],j);
            }
        }
        if(i != tmp.second) cnt++;
        swap(a[i],a[tmp.second]);
    }
    rep(i,0,n){
        printf("%lld%s", a[i], (i == n-1)? "\n": " ");
    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 3256
// Problem : D - Line++
// Contest : AtCoder Beginner Contest 160
// URL : https://atcoder.jp/contests/abc160/tasks/abc160_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//QWsin
#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=nxt[i])
#define repvc(i,vc) for(int i=0,Sz=vc.size();i<Sz;++i)
using namespace std;
inline int read()
{
	char ch=getchar();int ret=0,f=1;
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0' && ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}

typedef long long ll;
const int INF=1<<30;

const int maxn=2000+10;
const int maxm=5000+10;

int first[maxn],nxt[maxm],ecnt,v[maxm];
void add_edge(int _u,int _v){
	nxt[ecnt]=first[_u];first[_u]=ecnt;v[ecnt++]=_v;
	nxt[ecnt]=first[_v];first[_v]=ecnt;v[ecnt++]=_u;
}

int n;
int dis[maxn],ans[maxn];
void solve(int s)
{
	rep(i,1,n) dis[i]=-1;
	dis[s]=0;
	queue<int>q;
	q.push(s);
	while(!q.empty())
	{
		int t=q.front();q.pop();
		for(int i=first[t];i!=-1;i=nxt[i]){
			if(dis[v[i]]==-1){
				dis[v[i]]=dis[t]+1;
				q.push(v[i]);
			}
		}
	}
	// rep(i,1,n) printf("%d%c",dis[i],i==n?'\n':' ');
	rep(i,1,n) ++ans[dis[i]];
}

int main()
{	
	cin>>n;
	rep(i,1,n) first[i]=-1;
	rep(i,1,n-1) add_edge(i,i+1);
	int x,y;cin>>x>>y;
	add_edge(x,y);
	rep(i,1,n) solve(i);
	rep(i,1,n-1) printf("%d\n",ans[i]/2);
	return 0;
}


Measured memory_bytes: 384