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


#define ll                 long long
#define mod                1000000007
#define pb                 push_back
#define pii                pair < int , int >
#define vecsort(v)         sort(v.begin(),v.end())
#define lcm(x,y)           (x/__gcd(x,y))*y
#define forn(i,n)          for(i = 0 ; i < n ; i++)
#define deb(x)             cout << #x << " " << x << endl;
#define T(t)               cout << "Case " << t <<": ";
#define scan(v)            for(int i = 0; i<n; i++){ll x;cin>>x;v.pb(x);}
#define fast_cin           ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fout               freopen("output.txt","w",stdout);


int main(){


    long long a ,b  , c, d;
    cin >> a >> b >> c >> d;
    ll p = a * c;
    ll q = a * d;
    ll r = b * c;
    ll t = b * d;
    cout << max( max(p,q),max(r,t)) << endl;




    return 0;
}

Measured memory_bytes: 3632
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("3 3");
            WillReturn.Add("1 7 11");
            //2
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("3 81");
            WillReturn.Add("33 105 57");
            //24
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("1 1");
            WillReturn.Add("1000000000");
            //999999999
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] wkArr = InputList[0].Split(' ').Select(p => int.Parse(p)).ToArray();
        int X = wkArr[1];

        int[] XArr = InputList[1].Split(' ').Select(p => int.Parse(p)).ToArray();

        var AbsList = new List<int>();
        foreach (int EachInt in XArr) {
            AbsList.Add(Math.Abs(EachInt - X));
        }
        int GCD = AbsList[0];
        foreach (int EachInt in AbsList.Skip(1)) {
            GCD = DeriveGCD(GCD, EachInt);
        }
        Console.WriteLine(GCD);
    }

    //ユークリッドの互除法で2数の最大公約数を求める
    static private int DeriveGCD(int pVal1, int pVal2)
    {
        pVal1 = Math.Abs(pVal1);
        pVal2 = Math.Abs(pVal2);

        int WarareruKazu = Math.Max(pVal1, pVal2);
        int WaruKazu = Math.Min(pVal1, pVal2);

        while (true) {
            int Amari = WarareruKazu % WaruKazu;
            if (Amari == 0) return WaruKazu;
            WarareruKazu = WaruKazu;
            WaruKazu = Amari;
        }
    }
}


Measured memory_bytes: 20704
#include <iostream>
#include <cstdio>
#include <cmath>
#include <queue>
#include <map>
#include <cstring>
#include <string>
#include <set>
#include <vector>
#include <list>
#include <deque>
#include <algorithm>
#include <stack>
#include <numeric>
#include <time.h>
#include<iomanip>
#pragma warning(disable:4996)
using namespace std;
const int inf = 0x7f7f7f7f;
const long long mod = 1e9 + 7;
struct noode {
	int t, x, y;
}a[120000];
int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i].t >> a[i].x >> a[i].y;
	if (a[0].t < a[0].x + a[0].y)
		cout << "No" << endl;
	else
	{
		if ((a[0].t - a[0].x - a[0].y) % 2 != 0)
			cout << "No" << endl;
		else
		{
			bool flag = false;
			for (int i = 1; i < n; i++)
			{
				int t, x, y;
				t = a[i].t - a[i - 1].t, x = abs(a[i].x - a[i - 1].x), y = abs(a[i].y - a[i - 1].y);
				if (t < x + y)
				{
					flag = true;
					break;
				}
				else if ((t - x - y) % 2 != 0)
				{
					flag = true;
					break;
				}
			}
			if (!flag)
				cout << "Yes" << endl;
			else
				cout << "No" << endl;
		}
	}
}
// 运行程序: Ctrl + F5 或调试 >“始执行(不调试)”菜单
// 调试程序: F5 或调试 >“开始调试”菜单
// 入门提示:
//   1. 使用解决方案资源管理器窗口添 加/管理文件
//   2. 使用团队资源管理器窗口连接到源代码管理
//   3. 使用输出窗口查看生成输出和其他消息
//   4. 使用错误列表窗口查看错误
//   5. 转到“项目”>“添加新项”以创建新的代码文件，或转到“项目”>“添加现有项”以将现有代码文件添加到项目
//   6. 将来，若要再次打开此项目，请转到“文件”>“打开”>“项目”并选择 .sln 文件

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

#define ll long long
#define F(i,m,n) for(ll i=m;i<n;i++)
#define Fr(j,n,m) for(ll j=n;j>=m;j--)
#define vll vector<ll>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vpll vector< pll >
#define tlll tuple < ll ,ll,ll >
/*-------------------------------------*---------------------------------------*/

#define godspeed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define deb(x) cout << #x << "=" << x << endl
#define cout_array(a) cout<<#a<<"=";for(auto x: a){ cout<<x<<" ";}cout<<endl

ll gcd(ll a,ll b){
    return (b?gcd(b,a%b):a);
}
const ll MAX_PRIME = 1e9+7;
const ll INF = 1e18;


/*I NEED YOU TO WORK FOR TWO HOURS ON THIS NO MATTER WHAT....THE RESULT DOESN'T MATTER.....ITS ALL ABOUT YOUR EFFORTS.
---------------------------------------------------------------------------------------------------------------------*/

ll fast_pow(ll x,ll y,ll z){
    if(y==0)return 1%z;
    else if(y==1)return x%z;
    if(y%2==0){
        ll res = fast_pow(x,y/2,z);
        return (res*res)%z;
    }
    else{
        ll res = fast_pow(x,y/2,z);
        ll temp = (res*res)%z;
        return ((x%z)*temp)%z;
    }
}

int main() {
    godspeed
    ll n,x,t;
    cin>>n>>x>>t;
    ll ans = (n/x)*t;
    if(n%x)ans+=t;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3648
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        ArrayList<Integer> al = new ArrayList<Integer>();
        int n = sc.nextInt();
        long m = sc.nextLong();
        int max = 100002;
        
        long[] C = new long[max];
        for(int i = 0; i < n; i++){
            int ai = sc.nextInt();
            al.add(ai);
            C[ai]++;
        }
 
        long[] CS = new long[max];
        for (int i = max-2; i >= 0; i--) {
            CS[i] += CS[i + 1] + C[i];
        }
        
        long[] S = new long[max];
        for (int i = max-2; i >= 0; i--) {
            S[i] = S[i + 1] + i * C[i];
        }
        Collections.sort(al);
        long left = 1;
        long right = 2*100000+1;
        while(right - left > 1){
            long mid = (left + right)/2;
            long cnt = getShakeCount(mid, al, CS);
            //System.out.println(cnt+" "+mid+" "+left+" "+right);
            if(cnt < m){
				right = mid;
			}else{
				left = mid;
			}
        }
        System.out.println(getHappinessPoint(left, right, m, al, CS, S));
    }
 
    private static long getShakeCount(long mid, ArrayList<Integer> al, long[] cs){
		int maxsize = cs.length;
		long ret = 0;
		for(int a : al){
            if(mid-a >= maxsize){
                continue;
            }
            ret +=cs[Math.max((int)mid - a, 0)];
		}
		return ret;
	}
    private static long getHappinessPoint(long left, long right, long m, ArrayList<Integer> al, long[] cs, long[] s){
		int maxsize = s.length;
		long ret = 0;
		long cnt = 0;
		for (int a : al) {
            if (right - a >= maxsize) {
                continue;
            }
            ret += a * cs[Math.max((int)right - a, 0)] + s[Math.max((int)right - a, 0)];
            cnt += cs[Math.max((int)right - a, 0)];
        }
        ret += left * (m - cnt);
		return ret;
	}
}

Measured memory_bytes: 65280
#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <numeric>
#include <bitset>
#include <map>
#include <limits.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<=n;i++)
using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;


/// 各桁の和
int sumdigit(int x){
   int sum = 0;
    while(x != 0){
        sum += x % 10;
        x /= 10;    
    }
    return sum;
}
/// 最大公約数 
int gcd(int x, int y){
      if(x<y){
          int temp = x;
          x = y;
          y = temp;
      }
      int r = x % y;
       while(r!=0){
           x = y;
           y = r;
           r = x % y;
       }
      return y;
   }



int main(){
    long long  N;
    cin >> N;
    vector<long long> p(5);
    REP(i,5){

     cin >> p[i];
    }
    long long min = *min_element(p.begin(),p.end());
    if(min >= N){
        cout << 5 << endl;
        return 0;
    }
    cout << (N+(min-1)) / min + 4 << endl; 
    }

Measured memory_bytes: 256
#ifndef _WIN32
#include<iostream>
#endif
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<string>
#include<stdlib.h>

using namespace std;

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

string s;
int id;

int mincost(){
	id ++;
	if (s[id] != '['){
		int num = 0;
		while (isdigit(s[id])){
			num *= 10;
			num += s[id] - '0';
			id++;
		}
		id++;
		return (num + 1) / 2;

	}
	else{
		vector<int> c;
		while (s[id] != ']'){
			c.push_back(mincost());
		}
		sort(c.begin(), c.end());
		int num = c.size() + 1;
		num /= 2;
		int res = 0;
		REP(i, num){
			res += c[i];
			//cout << c[i] << endl;
		}
		id++;
		return res;

	}



}

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

	cout << fixed << setprecision(30);
	int n;
	cin >> n;
	REP(qqqq, n){
		cin >> s;
		id = 0;
		cout << mincost() << endl;

	}
	return 0;
}

Measured memory_bytes: 3260
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

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

    string s;
    cin >> s;
    int n = s.length();
    int ans = INF;
    int cnt1 = 0, cnt2 = 0;
    for(int i = 0; i < n; ++i){
        if(i % 2 == 0){
            if(s[i] == '1') ++cnt1;
            else    ++cnt2;
        }
        else{
            if(s[i] == '0') ++cnt1;
            else    ++cnt2;
        }
    }
    chmin(ans, cnt1);
    chmin(ans, cnt2);
    cout << ans << endl;
}

Measured memory_bytes: 512
#include<iostream>
using namespace std;
#define MAX 101
int w,h;
char map[MAX][MAX];
int DX[] = {0,1,0,-1};
int DY[] = {-1,0,1,0};
int rec(int y,int x,char c){
	if(map[y][x] == '.')return 0;
	map[y][x] = '.';
	for(int i= 0;i < 4;i++){
		int nx = x + DX[i];
		int ny = y + DY[i];
		if(nx < 0 || nx >= w)continue;
		if(ny < 0 || ny >= h)continue;
		if(map[ny][nx] != c)continue;
		rec(ny,nx,c);
	}
	return 1;
}

int main(){
	while(true){
		cin >> h>>w;
		if(!(w||h))break;
		int ans = 0;
		for(int i=0; i < h;i++){
			cin >> map[i];
		}
		for(int i = 0; i < h;i++){
			for(int j = 0; j < w;j++){
				if(map[i][j] == '.')continue;
				ans += rec(i,j,map[i][j]);
			}
		}
		cout << ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using  namespace std;
typedef long long ll;
int main(){
    ll x,ans=0,check=0;
    cin >> x;
    
    for(ll i=1;i<=x;i++){
        ans++;
        check+=i;
        if(check>=x){
            break;
        }
    }

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


Measured memory_bytes: 256
from collections import Counter


class UnionFind:
    def __init__(self, n):
        self.n = n
        self.p = [e for e in range(n)]
        self.rank = [0] * n

    def same(self, u, v):
        return self.find_set(u) == self.find_set(v)

    def unite(self, u, v):
        self.link(self.find_set(u), self.find_set(v))

    def find_set(self, u):
        if u != self.p[u]:
            self.p[u] = self.find_set(self.p[u])

        return self.p[u]

    def link(self, u, v):
        if self.rank[u] > self.rank[v]:
            self.p[v] = u
        else:
            self.p[u] = v
            if self.rank[u] == self.rank[v]:
                self.rank[v] += 1

    def update_p(self):
        for u in range(self.n):
            self.find_set(u)


n, m, k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
cd = [list(map(int, input().split())) for _ in range(k)]

uf = UnionFind(n)

for a, b in ab:
    a -= 1
    b -= 1
    uf.unite(a, b)

uf.update_p()

counter = Counter(uf.p)

ans = [counter[uf.p[i]] - 1 for i in range(n)]


def f(li):
    for e1, e2 in li:
        e1 -= 1
        e2 -= 1
        if uf.same(e1, e2):
            ans[e1] -= 1
            ans[e2] -= 1


f(ab)
f(cd)

print(*ans)


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

int main()
{
    long long x,y;
    std::cin >> x >> y;
    int cnt = 1;
    long long cur = x;
    while(true){
        cur *= 2;
        if(cur >= x && cur <= y){
            cnt++;
        }else{
            break;
        }
    }
    std::cout << cnt << std::endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    if (S.equals("Sunny")){
      System.out.println("Cloudy");
    }
    if (S.equals("Cloudy")){
      System.out.println("Rainy");
    }
    if (S.equals("Rainy")){
      System.out.println("Sunny");
    }
        
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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;}
const int INF = 1e9;
const ll LLINF = 1e16;

int main(void)
{
    set<string> keihin;
    ll n;
    cin >> n;
    REP(i, n)
    {
        string tmp;
        cin >> tmp;
        keihin.insert(tmp);
    }
    cout << keihin.size() << endl;
    return 0;
}

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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int a, b; cin >> a >> b;
  int sum = (max(0,4-a)+max(0,4-b))*100000;
  cout << (sum==600000?1000000:sum) << endl;
  return 0;
}


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

using namespace std;

#define _int64 long long

int used[500][500];
int a[110000][2];
int dead[500];
set<pair<int,int> > st;

int main()
{
  int i,j,k,n,m,ans,b1,f1,f2;
  scanf("%d%d",&n,&m);
  st.clear();
  memset(dead,0,sizeof(dead));
  for (i=0;i<m;i++)
  {
    scanf("%d%d",&a[i][0],&a[i][1]);
    a[i][0]--;
    a[i][1]--;
    if (a[i][0]>a[i][1]) swap(a[i][0],a[i][1]);
    if (st.find(make_pair(a[i][0],a[i][1]))!=st.end())
    {
      dead[a[i][0]]=1;
      dead[a[i][1]]=1;
    }
    else st.insert(make_pair(a[i][0],a[i][1]));
    if (dead[a[i][0]]==1) dead[a[i][1]]=1;
    if (dead[a[i][1]]==1) dead[a[i][0]]=1;
  }
  memset(used,0,sizeof(used));
  for (i=0;i<n;i++)
  {
    used[i][i]=1;
    for (j=0;j<m;j++)
    {
      f1=0;
      f2=0;
      if (used[i][a[j][0]]>=1) f1=min(used[i][a[j][0]],2);
      if (used[i][a[j][1]]>=1) f2=min(used[i][a[j][1]],2);
      if (f1>=1) used[i][a[j][1]]+=f1;
      if (f2>=1) used[i][a[j][0]]+=f2;
    }
  }
  ans=0;
  for (i=0;i<n;i++)
    for (j=i+1;j<n;j++)
    {
      b1=1;
      for (k=0;k<n;k++)
        if (used[k][i]>=2)
        {
          b1=0;break;
        }
      if (b1==0) continue;
      for (k=0;k<n;k++)
        if (used[k][j]>=2)
        {
          b1=0;break;
        }
      if (b1==0) continue;
      for (k=0;k<n;k++)
        if ((used[k][i]>=1)&&(used[k][j]>=1))
        {
          b1=0;
          break;
        }
      if (b1==0) continue;
      if (b1==1)
      {
        //printf("%d %d\n",i+1,j+1);
        ans++;
      }
    }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 4736
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <cstring>
#include <ctime>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
const int maxn = 100005;

int main() {
  //  freopen("in.cpp","r",stdin);
    int k,s;
    cin>>k>>s;
    int ret = 0;
    for(int i=0;i<=k;i++)
      for(int j=0;j<=k&&j+i<=s;j++)
         if(s-i-j<=k)
        ret++;
        cout<<ret<<endl;
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
void file(){
    freopen("read.in","r",stdin);
    freopen("write.out","w",stdout);
}
const int N=500010;
inline int read(){
    int sym=0,res=0;char ch=getchar();
    while (!isdigit(ch))sym|=(ch=='-'),ch=getchar();
    while (isdigit(ch))res=(res<<3)+(res<<1)+(ch^48),ch=getchar();
    return sym?-res:res;
}
int n,k,s;
int main(){
    n=read();k=read();s=read();
    if (s==1e9){
        for (int i=1;i<=k;i++){
            printf("%d ",s);
        }
        for (int i=k+1;i<=n;i++){
            printf("%d ",s-1);
        }
        return 0;
    }
    for (int i=1;i<=k;i++){
        printf("%d ",s);
    }
    for (int i=k+1;i<=n;i++){
        printf("%d ",s+1);
    }
    return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define repz(i, z, n) for (decltype(n) i = (z); i < (n); i++)
#define rep(i, n) for (decltype(n) i = 0; i < (n); i++)

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "Yes" << endl;
#define POK cout << "OK" << endl;
#define PNO cout << "No" << endl;
#define PNG cout << "NG" << endl;

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;

// const
// 円周率
const double pi = M_PI;
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)

int main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int a, b, t;
  cin >> a >> b >> t;
  cout << (2 * t + 1) / (2 * a)*b << endl;

  return 0;
}


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

using namespace std;

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

  string s, t;
  cin >> s >> t;

  int n = s.size();
  string res = "No";
  for (int i = 0; i < n; ++i) {
    if (t == s.substr(i, n-i) + s.substr(0, i)) {
      res = "Yes";
      break;
    }
  }
  cout << res << endl;

  return 0;
}



Measured memory_bytes: 256
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>

#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>

#include <cmath>
#include <numeric>
#include <random>
#include <cstring>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <stack>

// type
#include <cstdint>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    int N, K, S;
    cin >> N >> K >> S;
    vector<int> A(N);
    if (S == 1e9) {
        for (int i= 0; i < N; i++) {
            if (i <= K-1) {
                A[i] = 1e9;
            } else {
                A[i] = 1;
            }
        }
    } else {
        for (int i= 0; i < N; i++) {
            if (i <= K-1) {
                A[i] = S;
            } else {
                A[i] = 1e9;
            }
        }
    }

    for (int i = 0; i < N; i++) {
        cout << A[i];
        if (i != N-1) cout << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define m_p make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define fi first
#define se second
typedef long long ll;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rnf(2106);

void solv()
{
    int x;
    scanf("%d", &x);
    for (int i = 1800, j = 1; i >= 400; i -= 200, ++j)
    {
        if (x >= i)
        {
            printf("%d\n", j);
            return;
        }
    }
}

int main()
{
    #ifdef SOMETHING
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    #endif // SOMETHING
    //ios_base::sync_with_stdio(false), cin.tie(0);
    solv();
    return 0;
}

//while ((double)clock() / CLOCKS_PER_SEC <= 0.9){}


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

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#define int long long
#define ll getchar();getchar();return 0;
using namespace std;
signed main(){
	int x,inf=-10000,ans;
	cin >> x;
  if(x==1)cout<<1<<endl;
  else{
	for (int i = 2; i <= sqrt(x); i++) {
		for (int j = i; j <= x; j *= i) {
          if(j>inf){
            inf=j;
            ans=j;
          }
		}
	}
    cout<<ans<<endl;
  }
}

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

class Dice{
public:
	int dice[6];
	int buff1, buff2, buff3;
	void south(){
		buff1 = dice[0];
		buff2 = dice[1];
		buff3 = dice[5];
		dice[0] = dice[4];
		dice[4] = buff3;
		dice[5] = buff2;
		dice[1] = buff1;
	}
	void north(){
		buff1 = dice[0];
		buff2 = dice[1];
		buff3 = dice[5];
		dice[0] = buff2;
		dice[1] = buff3;
		dice[5] = dice[4];
		dice[4] = buff1;
	}
	void west(){
		buff1 = dice[0];
		buff2 = dice[2];
		buff3 = dice[5];
		dice[0] = buff2;
		dice[2] = buff3;
		dice[5] = dice[3];
		dice[3] = buff1;
	}
	void east(){
		buff1 = dice[0];
		buff2 = dice[2];
		buff3 = dice[5];
		dice[2] = buff1;
		dice[5] = buff2;
		dice[0] = dice[3];
		dice[3] = buff3;
	}
};

int main()
{
	Dice d;
	for(int n = 0; n < 6; n++)
		cin >> d.dice[n];

	string command;
	string::iterator itr;
	char direction;
	cin >> command;
	for(itr = command.begin(); itr != command.end(); itr++){
		direction = *itr;
		if(direction == 'N')
			d.north();
		if(direction == 'S')
			d.south();
		if(direction == 'E')
			d.east();
		if(direction == 'W')
			d.west();
	}
	cout << d.dice[0] << endl;
}

Measured memory_bytes: 1204
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <utility>
#include <tuple>
#include <map>
#include <ctime>
#include <cstdlib>
#include <random>
using namespace std;

#define int long long

signed main(){
	string s;
	cin >> s;
	if(s[2] == s[3] && s[4] == s[5])cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using static System.Math;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;
using MethodImplAttribute = System.Runtime.CompilerServices.MethodImplAttribute;

public static class P
{
    public static void Main()
    {
        int n = Reader.NextInt;
        int last = 0;
        int cur = 0;
        int max = 0;
        for (int i = 0; i < n; i++)
        {
            var h = Reader.NextInt;
            if (last >= h) max = Max(max, ++cur);
            else cur = 0;
            last = h;
        }
        Console.WriteLine(max);
    }
}

static class Reader
{
    const int BUF_SIZE = 1 << 12;
    static Stream Stream = Console.OpenStandardInput();
    static byte[] Buffer = new byte[BUF_SIZE];
    static int ptr = 0;

    private static void Read() { Stream.Read(Buffer, 0, BUF_SIZE); }

    private static void Move() { if (++ptr >= Buffer.Length) { Read(); ptr = 0; }  }

    public static int NextInt
    {
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        get
        {
            int res = 0; while (Buffer[ptr] < 48) Move();
            do { res = res * 10 + (Buffer[ptr] ^ 48); Move(); } while (48 <= Buffer[ptr]);
            return res;
        }
    }

    public static int NextSInt
    {
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        get
        {
            int res = 0; int sign = 1; 
            while (Buffer[ptr] < 45) Move(); if (Buffer[ptr] == 45) { Move(); sign = -1; }
            do { res = res * 10 + (Buffer[ptr] ^ 48); Move(); } while (48 <= Buffer[ptr]);
            return res * sign;
        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<cstdio>

using namespace std;
typedef pair<long long,bool> Pair;

const long long INF = 1LL << 60;

int main(){

  long long N,K;
  long long h[100001];
  long long DP[100001];
  long long temp;

  cin >> N >> K;

  for (long long i = 0; i < N;++i) cin >> h[i];

  DP[0] = 0;

  for (long long i = 1; i < N;++i){

    long long minValue = INF;

    for(long long j = 1; j <= K;++j){

      if(i - j >= 0){
        
        temp = DP[i-j] + abs(h[i] - h[i - j]);
        if(minValue > temp)  minValue = temp;

      }

    }

    DP[i] = minValue;

  }

  cout << DP[N-1] << endl;

  return 0;

}

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

int main()
{
	int D, N, count = 0, ans;

	cin >> D >> N;

	if (N == 100) {
		count = 1;
	}
	
	if (D == 0) {
		ans = N + count;
	}

	else {
		ans = (N + count) * pow(100, D);
	}
	cout << ans << endl;
}

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

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

using namespace std;

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

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

  map<char, int> mp;
  for (char c : w) {
    mp[c]++;
  }

  bool ok = true;
  for (auto v:mp) {
    if (v.second % 2 == 1) {
      ok = false;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
using namespace std;
int n,minn=-1,sum;
int main() {
    scanf("%d",&n);
    for(int i=1;i<=n;++i) {
        int x;
        scanf("%d",&x);
        sum+=x;
        if(x%10)
            if(minn==-1 || x<minn)
                minn=x;
    }
    if(sum%10) printf("%d\n",sum);
    else {
        if(minn==-1) minn=sum;
        printf("%d\n",sum-minn);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define leng(n) (int)(log10(n)+1)
#define INF 9000000000000000000
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm

signed main() {
  int n,m;
  cin >> n >> m;
  int ma = INF;
  int mi = 0;
  int s,t;
  rep(i,0,m){
    cin >> s >> t;
    ma = min(t,ma);
    mi = max(s,mi);
  }
  cout << max(0LL,ma-mi+1) << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
double stdev(int s[], int n)
{
    double sum = 0;
    for (int i = 0; i < n; i++)
    {
        sum = sum + s[i];
    }
    double aver = sum / n;
    double v = 0;
    for (int i = 0; i < n; i++)
    {
        v = v + pow(s[i] - aver, 2);
    }
    v = v / n;
    return sqrt(v);
}
int main()
{
    int n, s[1000];
    do
    {
        scanf("%d", &n);
        if (n == 0)
        {
            break;
        }

        for (int i = 0; i < n; i++)
        {
            scanf("%d", &s[i]);
        }
        double sd = stdev(s, n);
        printf("%.8lf\n", sd);
    } while (n != 0);
    return 0;
}


Measured memory_bytes: 2028
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const long long INF = 1LL << 60;

// 入力
int N, k;
long long h[100010];

// DP テーブル
long long dp[100010];

int main() {
    int N, k; cin >> N >> k;
    for (int i = 0; i < N; ++i) cin >> h[i];

    // 初期化 (最小化問題なので INF に初期化)
    for (int i = 0; i < 100010; ++i) dp[i] = INF;

    // 初期条件
    dp[0] = 0;

    // ループ
    for (int i = 0; i < N; ++i) {
      for (int j = 1; j <= k; j++) {
        chmin(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
    }
    }

    // 答え
    cout << dp[N-1] << endl;
}


Measured memory_bytes: 1792
#define NDEBUG
#include<deque>
#include<functional>
#include<utility>
#include<cstddef>
#include<cassert>

template<typename T, class Compare = std::less<T>>
class SlidingMinimum{
public:
	using value_compare = Compare;
	using value_type = T;
	using size_type = std::size_t;
	using container_type = std::deque<std::pair<const value_type, size_type>>;
protected:
	container_type c;
	value_compare comp;
public:
	SlidingMinimum(const value_compare &x = value_compare()) :comp(x){}
	const value_type &top()const{
		return c.front().first;
	}
	const size_type top_index()const{
		return c.front().second - 1;
	}
	void push(const value_type &x){
		size_type s = 1;
		while (!c.empty() && comp(x, c.back().first)){
			s += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<const value_type, size_type>(x, s));
	}
	void push(value_type &&x){
		size_type s = 1;
		while (!c.empty() && comp(x, c.back().first)){
			s += c.back().second;
			c.pop_back();
		}
		c.push_back(std::pair<const value_type, size_type>(std::move(x), s));
	}
	void pop(){
		assert(!c.empty());
		if (!(--c.front().second))
			c.pop_front();
	}
};


#include<cstdio>
#include<utility>

int main(){
	int n, l;
	scanf("%d%d", &n, &l);
	SlidingMinimum<int> S;
	int a;
	n -= l;
	while (l--){
		scanf("%d", &a);
		S.push(std::move(a));
	}
	printf("%d", S.top());
	while (n--){
		S.pop();
		scanf("%d", &a);
		S.push(std::move(a));
		printf(" %d", S.top());
	}
	printf("\n");
	return 0;
}



Measured memory_bytes: 3336
#include<stdio.h>
int main(){
	int i,j,H,W,a[100][100],b[100];
	long long int t;
	scanf("%d %d",&H,&W);
	for(i=0;i<H;i++){
		for(j=0;j<W;j++){
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<W;i++)
                        scanf("%d",&b[i]);
	for(i=0;i<H;i++){
		t=0;
		for(j=0;j<W;j++)
                t+=a[i][j]*b[j];
		printf("%d\n",t);
	}
	return 0;
}


Measured memory_bytes: 2108
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((x)&(-(x)))
#define sqr(a) ((a)*(a))
#define clr(a) (memset((a),0,sizeof(a)))
#define ls ((x)<<1)
#define rs (((x)<<1)|1)
#define mid (((l)+(r))>>1)
#define pb push_back
#define w1 first
#define w2 second
inline void read(int &x){
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}
/*******************************head*******************************/
const int maxn=205;
int head[maxn],t[maxn<<1],ne[maxn<<1],num,C[maxn][maxn],dfn[maxn],low[maxn],S[maxn];
bool vis[maxn],ins[maxn];
const int mod=1e9+7;
inline int powmod(int a,int b){
	int res=1;for(;b;b>>=1){
		if(b&1)res=1ll*res*a%mod;
		a=1ll*a*a%mod;
	}return res;
}

inline void addedge(int x,int y){
	ne[++num]=head[x];head[x]=num;t[num]=y;
	ne[++num]=head[y];head[y]=num;t[num]=x;
}
bool flag[maxn];
int ans,n,m,k,clk,top;
inline void calc(int x,int y){
	int cntv=0,cnte=0;
	memset(flag,0,sizeof(flag));cntv=flag[y]=1;
    for(;S[top+1]!=x;flag[S[top--]]=1,++cntv);
    rep(w,1,n)if(flag[w])forE(i,w)cnte+=flag[t[i]];cnte/=2;
	if(cnte<cntv){
		ans=1ll*ans*k%mod;
		return;
	}
	if(cnte>cntv){
		ans=1ll*ans*C[cnte+k-1][k-1]%mod;
		return;
	}
	int res=0;
	rep(i,1,cntv){
		res=(res+powmod(k,__gcd(i,cntv)))%mod;
	}
	ans=1ll*res*ans%mod*powmod(cntv,mod-2)%mod;
}
inline void dfs(int x){
    S[++top]=x;dfn[x]=low[x]=++clk;
    forE(i,x)
        if (dfn[t[i]])
            low[x]=min(low[x],dfn[t[i]]);
        else{
            dfs(t[i]),low[x]=min(low[x],low[t[i]]);
            if (low[t[i]]>=dfn[x])
                calc(t[i],x);
		}
}
inline void prprpr(){
	rep(i,0,200){
		C[i][0]=1;
		rep(j,1,i)C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
	}
}
int main(){
	read(n);read(m);read(k);
	rep(i,1,n)head[i]=-1;
	rep(i,1,m){
		int x,y;read(x);read(y);
		addedge(x,y);
	}prprpr();ans=1;
	rep(i,1,n)if(!dfn[i])dfs(i);
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 384
n=int(input())
a=list(map(int,input().split()))

num=[0]*(10**5+2)

for i in range(n):
    num[a[i]+1]+=1

ruiseki=[0]*(10**5+2)
for i in range(1, 10**5+1):
    ruiseki[i]=num[i-1]+num[i]+num[i+1]

print(max(ruiseki))

Measured memory_bytes: 52420
#ABC089C
N=int(input())
S=sorted(list(map(str, [input() for i in range(N)])))
MARCH=[0]*5
ans=0

for i in range(N):
    Cap=S[i][0]
    if Cap=="M":
        MARCH[0]+=1
    elif Cap=="A":
        MARCH[1]+=1
    elif Cap=="R":
        MARCH[2]+=1
    elif Cap=="C":
        MARCH[3]+=1
    elif Cap=="H":
        MARCH[4]+=1

for i in range(3):
    for j in range(i+1, 4):
        for k in range(j+1, 5):
            ans+=MARCH[i]*MARCH[j]*MARCH[k]
print(ans)

Measured memory_bytes: 10784
#include <stdio.h>
#include <math.h>

int main(void)
{
	int i, n, s, b[200], a[200];
	s=0;
	b[0]=200000;
	scanf("%d", &n);
	
	for(i=1;i<n;i++){
		scanf("%d", &b[i]);
		if(b[i-1]<b[i]){
			a[i]=b[i-1];
		}
		else{
			a[i]=b[i];
		}
		s=s+a[i];
	}
	s=s+b[n-1];

	printf("%d", s);
	return 0;
}

Measured memory_bytes: 128
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
  static Scanner sc = new Scanner(System.in);
  static long startTime = System.currentTimeMillis();
  static int N;
  static int[] A;
  static Node[] nodes;

  public static void main(String[] args) {
    N = sc.nextInt();
    A = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = Integer.parseInt(sc.next());
    }
    if (N == 2) {
      System.out.println(A[0] == A[1] ? "YES" : "NO");
      return;
    }
    nodes = new Node[N];
    for (int i = 0; i < N; i++) {
      nodes[i] = new Node(i);
    }
    for (int i = 0; i < N - 1; i++) {
      int a = Integer.parseInt(sc.next()) - 1;
      int b = Integer.parseInt(sc.next()) - 1;
      nodes[a].next.add(nodes[b]);
      nodes[b].next.add(nodes[a]);
    }
    boolean ans = false;
    for (int i = 0; i < N && !ans && System.currentTimeMillis() - startTime < 1600; i++) {
      if (nodes[i].next.size() > 1) {
        ans |= solve(i);
      }
    }
    System.out.println(ans ? "YES" : "NO");
  }

  static boolean solve(int root) {
    int[] order = new int[N];
    order[0] = root;
    int pos = 1;
    for (int i = 0; i < N; i++) {
      nodes[i].parent = -1;
    }
    for (int i = 0; i < N; i++) {
      Node cur = nodes[order[i]];
      for (Node c : cur.next) {
        if (c.idx == cur.parent) continue;
        c.parent = cur.idx;
        order[pos++] = c.idx;
      }
    }
    for (int i = N - 1; i >= 0; i--) {
      long sum = 0;
      long max = 0;
      Node n = nodes[order[i]];
      boolean hasChild = false;
      for (Node c : n.next) {
        if (c.idx == n.parent) continue;
        sum += c.v;
        max = Math.max(max, c.v);
        hasChild = true;
      }
      if (!hasChild) continue;
      if (sum < A[n.idx]) {
        return false;
      }
      long dec = sum - A[n.idx];
//      System.out.println(order[i] + " " + sum + " " + max + " " + dec);
      if (max > sum - max) {
        long c = sum - max;
        if (c < dec) {
          return false;
        }
      }
      n.v = sum - dec * 2;
      if (n.v < 0) {
        return false;
      }
    }
    return nodes[root].v == 0;
  }


  static class Node {
    int idx;
    long v;
    int parent = -1;
    ArrayList<Node> next = new ArrayList<>();

    public Node(int idx) {
      this.idx = idx;
      this.v = A[idx];
    }
  }
}


Measured memory_bytes: 92672
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
#define all(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,k,n) for(int i=(k);i<(n);++i)

typedef pair<long long,int> P;
struct edge {
    int to; long long cost;
};

struct Maze {
    int H, W;
    long long cost1=1, cost2=INF, cost3=INF, cost4=INF;
    vector<string> maze;
    Maze(int H, int W, vector<string> maze) : H(H), W(W), maze(maze) {}
    vector<int> di={1,0,-1,0}, dj={0,1,0,-1};
    vector<vector<edge>> G;
    void Ginit() {
        G.resize(H*W);
        for(int i=0;i<H;++i) {
            for(int j=0;j<W;++j) {
                for (int k=0;k<4;k++) {
                    int ni = i + di[k];
                    int nj = j + dj[k];
                    if(0<=ni&&ni<H&&0<=nj&&nj<W) {
                        long long cost=0;
                        if(maze[i][j]=='.'&&maze[ni][nj]=='.') cost=cost1;
                        else if(maze[i][j]=='.'&&maze[ni][nj]=='#') cost=cost2;
                        else if(maze[i][j]=='#'&&maze[ni][nj]=='.') cost=cost3;
                        else if(maze[i][j]=='#'&&maze[ni][nj]=='#') cost=cost4;
                        if(cost!=INF) G[i*W+j].push_back((edge){ni*W+nj,cost});
                    }
                }
            }
        }
    }

    vector<vector<long long>> d;
    void dinit() {
        d.resize(H*W);
        for(int i=0;i<H*W;++i) d[i].resize(H*W);
        for(int i=0;i<H*W;++i) {
            for(int j=0;j<H*W;++j) d[i][j] = INF;
            d[i][i] = 0;
        }
        for(int i=0;i<H;++i) {
            for(int j=0;j<W;++j) {
                for (int k=0;k<4;k++) {
                    int ni = i + di[k];
                    int nj = j + dj[k];
                    if(0<=ni&&ni<H&&0<=nj&&nj<W) {
                        long long cost=0;
                        if(maze[i][j]=='.'&&maze[ni][nj]=='.') cost=cost1;
                        else if(maze[i][j]=='.'&&maze[ni][nj]=='#') cost=cost2;
                        else if(maze[i][j]=='#'&&maze[ni][nj]=='.') cost=cost3;
                        else if(maze[i][j]=='#'&&maze[ni][nj]=='#') cost=cost4;
                        d[i*W+j][ni*W+nj] = cost;
                    }
                }
            }
        }
    }

};

void dijkstra(int s, vector<long long> &d, const vector<vector<edge>> &G){
    priority_queue<P,vector<P>,greater<P>> que;
    fill(d.begin(),d.end(),INF);
    d[s]=0;
    que.push(P(0,s));
    while(!que.empty()){
        P p=que.top();que.pop();
        int v=p.second;
        if(d[v]<p.first)continue;
        for(int i=0;i<G[v].size();i++){
            edge e=G[v][i];
            if(d[e.to]>d[v]+e.cost){
                d[e.to]=d[v]+e.cost;
                que.push(P(d[e.to],e.to));
            }
        }
    }
}

int main() {
    int H, W; cin >> H >> W;
    vector<string> maze(H);
    REP(i,H) cin >> maze[i];
    Maze MZ(H,W,maze); MZ.dinit();
    REP(k,H*W)REP(i,H*W)REP(j,H*W) MZ.d[i][j] = min(MZ.d[i][j],MZ.d[i][k]+MZ.d[k][j]);
    ll ans = 0;
    REP(i,H*W)REP(j,H*W)if(MZ.d[i][j]!=INF)ans = max(ans, MZ.d[i][j]);
    cout << ans << endl;
}

Measured memory_bytes: 1536
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cstring>
#include<cmath>
#include <numeric>
#include<queue>
#include<climits>
#include<cstdio>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
//#define INF ((LLONG_MAX) / (2))
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;
typedef pair<ll,int> LL_IP;
#define INF 1e9+7
#define N_MAX 1001


int n,m,b,c;
int arr[N_MAX];
int cost[N_MAX];

int main(){

    ll a,b,k;
    cin >> a >> b >> k;
    for(int i = 0;i < k;i++){

        if(i % 2 == 0){
            //高橋君
            if(a % 2 == 1){
                a--;
            }
            b += a/2;
            a/=2;
        }else{
            //青木君
            if(b % 2 == 1){
                b--;
            }
            a += b/2;
            b/=2;
        }
    }
    cout << a << " " << b << endl;

   

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
	string a;int flag=0;
	cin>>a;
	int b=a[0]-'0';
	for(int i=1;i<4;i++){
		if(a[i]-'0'==b){
			flag=1;
		}
		b=a[i]-'0';
	}
	if(flag){
		cout<<"Bad";
	}else{
		cout<<"Good";
	}
	return 0;
}

Measured memory_bytes: 256
N = int(input())
S = input()
hitoketa = set()
futaketa = set()
ans = set()
for s in S:
    for n in futaketa:
        ans.add(n+s)
    for n in hitoketa:
        futaketa.add(n+s)
    hitoketa.add("1"+s)
print(len(ans))

Measured memory_bytes: 3188
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;

int main(){

	int r,c;

	while(true){
		scanf("%d %d",&r,&c);
		if(r == 0 && c == 0)break;

		if(r*c%2 == 0){
			printf("yes\n");
		}else{
			printf("no\n");
		}
	}

	return 0;
}

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

int N,K;
long double res=0.0L;
int main(){
  cin >> N >> K;
  for(int i=1;i<=N;i++){
    int cnt=0;
    while(i*pow(2,cnt)<K) cnt++;
    res+=(1.0L/N)*pow(0.5,cnt);
  }
  printf("%.9Lf\n",res);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f first
#define s second
#define pb push_back
typedef vector<int> vi;
#define mod 1000000007
#define maxn 405
#define nos ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
int dp[maxn][maxn],cost[maxn][maxn];
int32_t main() {
    nos;
    int n;
    cin>>n;
    vi a(n),pre(n+1,0);
    for(auto &i:a)
    cin>>i;
    
    for(int i=1;i<=n;i++)
    pre[i]=a[i-1]+pre[i-1];
    for(int i=1;i<=n;i++)
    for(int j=i;j<=n;j++)
    dp[i][j]=pre[j]-pre[i-1];
    
    for(int l=1;l<=n-1;l++)
    {
     for(int i=1;i<=n-l;i++)
     { 
         int j=i+l;
        cost[i][j]=LLONG_MAX;
        for(int k=i;k<j;k++)
        {
        cost[i][j]=min(cost[i][j],cost[i][k]+cost[k+1][j]+dp[i][j]);
        }
     }
    }
    cout<<cost[1][n];
    return 0;
}


Measured memory_bytes: 6112
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<string.h>
#include<complex>
#include<math.h>
using namespace std;
typedef long long int llint;
#define rep(i,n) for(int i=0;i<n;i++)

bool check(char a, char b) {
	return a > b;
}

int kuraiwa(int n) {
	int ans = 0;
	while (n > 0) {
		ans += n % 10;
		n /= 10;
	}
	return ans;
}

int main() {
	int n;
	cin >> n;
	vector<int>x(n);
	rep(i, n) {
		cin >> x[i];
	}
	sort(x.begin(), x.end());
	int a = 0, b = 0;
	rep(i, n) {
		if (i % 2 == 0) {
			a += x[i];
		}
		else {
			b += x[i];
		}
	}
	cout << abs(a - b) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  
  int n,i,a,b,c,max,y,z;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    
    scanf("%d %d %d",&a,&b,&c);
    max=a;
    z=b;
    y=c;
    if(b>max){
      max=b;
      z=a;
      if(c>max){
	max=c;
	y=b;
      }
    }
    else if(c>max){
      max=c;
      z=a;
      y=b;
    }
    
    max=max*max;
    z=z*z+y*y;
    
    if(max==z){
      printf("YES\n");
    }
    else{
      printf("NO\n");
    }
    
  }
  
  return 0;
}

Measured memory_bytes: 580