akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pii pair<ll,ll>
#define vi vector<ll>
#define vii vector<pii>
#define f(i,a,b) for(ll i=a;i<b;i++)

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

   ll n=0,j=0;
   cin>>n;

   ll a[n];
   vector<vii> dp(n);

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

   f(i,0,n)
    {
      f(j,0,n)
       {
        dp[i].push_back(make_pair(0,0));
       }
    }

    f(k,0,n)
    {
      f(i,0,n)
       {
          j = i + k;

          if(j>=n)
            continue;

          if(i==j)
          {
            dp[i][j].first = a[i];
            dp[i][j].second = 0;
          }

          else if((a[i] + dp[i+1][j].second) > (a[j] + dp[i][j-1].second))
          {
            dp[i][j].first = a[i] + dp[i+1][j].second;
            dp[i][j].second = dp[i+1][j].first;
          }

          else{
            dp[i][j].first = a[j] + dp[i][j-1].second;
            dp[i][j].second = dp[i][j-1].first;
          }
       }
    }

   cout<<dp[0][n-1].first - dp[0][n-1].second;
  return 0;
}


Measured memory_bytes: 156044
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val seq = Range(0, n).map(_ => sc.nextInt).toSeq

  val sum = seq.sum
  val min = seq.filter(_ % 10 != 0).toStream.sorted.find(_ => true)

  if (sum % 10 != 0) {
    println(sum)
  } else {
    println(min match {
      case Some(n) => sum - n
      case None => 0
    })
  }
}


Measured memory_bytes: 25644
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

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

    int a = 1;
    int b = n;
    for(int i=0; i<m; ++i){
        if(n % 2 == 0 && i == n / 4)
            -- b;
        cout << a << ' ' << b << endl;
        ++ a;
        -- b;
    }

    return 0;
}


Measured memory_bytes: 3636
#!/mnt/c/Users/moiki/bash/env/bin/python
# N,M = map(int, input().split())
N = int(input())
trains = [ [int(j) for j in input().split()] for _ in range(N-1)] + [(0,0,0)]


for i in range(0,N):
    ans_i = 0
    for j in range(i, N-1):
        c,s,f = trains[j]
        ans_i = max(ans_i, s)
        ans_i += c + (f - ans_i%f)%f 
    print(ans_i)

exit(0)


dp = [float("inf") for _ in range(N-1)] + [0] # N-1

t = trains[N-2]
dp[N-2] = t[0]+t[1]
limited_by = [0 for _ in range(N)]
limited_by[N-2] = t[1]

for i in range(N-3, -1, -1):
    c,s,f = trains[i]
    nc,ns,nf = trains[i+1]
    arrive_at = c+s # start with A : B # at next station

    if arrive_at < limited_by[i+1]:
        dp[i] = dp[i+1]
        limited_by[i] = limited_by[i+1] -c 

    else:
        dp[i] = arrive_at+ (f - arrive_at%f)%f + dp[i+1] - ns
        limited_by[i] = s

for i in range(N): print(dp[i])
# print(limited_by)



# print(dp)
# 
# 
# for i in range(N-3, -1, -1):
#     c,s,f = trains[i]
#     nc,ns,nf = trains[i+1]
#     arrive_at = c+s
#     # print("i: ", i, "c,s,f: ", c,s,f, end=" ")
#     # print("arrive_at: ", arrive_at, end=" ")
#     # print(" arrive_at<ns: ", arrive_at < ns)
# 
#     if arrive_at < ns:
#         dp[i] = dp[i+1]
#         limited_by[i] = ns - c
#     elif arrive_at < limited_by[i+1]:
#         dp[i] = dp[i+1]
#         limited_by[i] = limited_by[i+1] - c
#     else:
#         # print("arrive_at: ", arrive_at, "f: ", f, "dp[i+1] : ", dp[i+1], "ns: ", ns)
#         dp[i] = arrive_at+ (f - arrive_at%f)%f + dp[i+1] - ns
# 


Measured memory_bytes: 42220
// abc131_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif

    string S;
    cin >> S;
    REP(i, S.size()-1){
        if (S[i] == S[i+1]){
            print("Bad");
            return 0;
        }
    }
    print("Good");

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    int n,i,ac=0,wa=0,tle=0,re=0;
    cin>>n;
    string s;
    //map<int,int>m;
    for(i=0;i<n;i++){
        cin>>s;
        if(s=="AC")
          ac++;
        else if(s=="WA")
           wa++;
        else if(s=="TLE")
           tle++;
        else
           re++;
    }
    cout<<"AC x "<<ac<<endl;
    cout<<"WA x "<<wa<<endl;
    cout<<"TLE x "<<tle<<endl;
    cout<<"RE x "<<re<<endl;
    return  0;
}


Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using static System.Console;

class Program {
	static void Main() {
		var N = NextInt();
		var ans = int.MaxValue;

		for (var i = 0; i < N; i++) {
			var A = NextInt();
			var cnt = 0;
			for (; A % 2 == 0; A /= 2) {
				cnt++;
			}
			ans = Math.Min(ans, cnt);
		}
		WriteLine(ans);
	}

	static int NextInt() {
		return int.Parse(NextString());
	}

	static string NextString() {
		var result = new List<char>();
		while (true) {
			int next = Read();
			if (next < 0)
				break;
			var nextChar = (char)next;
			if (!char.IsWhiteSpace(nextChar))
				result.Add(nextChar);
			else if (nextChar != '\r')
				break;
		}
		return string.Join("", result);
	}
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FASTIO ios_base::sync_with_stdio(false);cout.tie(NULL);cout.tie(NULL);
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define vi vector<ll>
const ll MAX=1e5+1e3;
const ll mod=1e9+7;
const ll inf=1e18+12;
set< pair<ll,ll> >ss;

ll arr[MAX];
                                                              //SAMEER KUMAR SINGH//
//================================================================================================================================//

int main(){
   FASTIO;
   ll tt=1;
   //cin>>tt;

   while(tt--){
       for(ll i=1;i<MAX;i++){
          arr[i]=INT_MAX;
       }

       ll n,w;cin>>n>>w;
       ll a[2][n];
       ll sum=0;
       for(ll i=0;i<n;i++){
           cin>>a[0][i]>>a[1][i];
           sum+=a[1][i];
       }

       for(ll i=0;i<n;i++){
         for(ll j=sum+1;j>=a[1][i];j--){
             arr[j]=min(arr[j],arr[j-a[1][i]]+a[0][i]);
         }
       }

       for(ll i=sum+1;i>=0;i--){
          if(arr[i]<=w){
            cout<<i;
            return 0;
          }
       }


   }

   return 0;
}


Measured memory_bytes: 1024
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	m := map[int]int{}

	N := nextInt()

	for i := 0; i < N; i++ {

		a := nextInt()

		if 1 <= a && a <= 399 {
			m[0]++
		} else if 400 <= a && a <= 799 {
			m[1]++
		} else if 800 <= a && a <= 1199 {
			m[2]++
		} else if 1200 <= a && a <= 1599 {
			m[3]++
		} else if 1600 <= a && a <= 1999 {
			m[4]++
		} else if 2000 <= a && a <= 2399 {
			m[5]++
		} else if 2400 <= a && a <= 2799 {
			m[6]++
		} else if 2800 <= a && a <= 3199 {
			m[7]++
		} else {
			m[8]++
		}
	}

	// wild := m[8]
	// s := make([]int, 0)
	// for k, v := range m {
	// 	if k == 8 {
	// 		continue
	// 	}

	// 	s = append(s, v)
	// }

	// sort.Ints(s)
	var max, min int
	if v, ok := m[8]; ok {
		if v == N {
			max = len(m) - 1 + v
			min = 1
		} else {
			max = len(m) - 1 + v
			min = len(m) - 1
		}
	} else {
		max = len(m)
		min = len(m)
	}

	fmt.Printf("%d %d\n", min, max)
}


Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;



int main()
{
	vector<string> w(100);
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> w[i];
	}

	//重複チェック
	for (int i = 0; i < n; i++) {
		for (int j = i+1; j < n; j++) {
			if (w[i] == w[j]) {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	//頭・尻文字チェック
	for (int i = 0; i < n - 1; i++) {
		//cout << "i:" << i << endl;
		//cout << "w[i].substr(w[i].length()-1, 1):" << w[i].substr(w[i].length()-1, 1) << endl;
		//cout << "w[i + 1].substr(1,1):" << w[i + 1].substr(0, 1) << endl;
		if (w[i].substr(w[i].length()-1, 1) != w[i + 1].substr(0,1)) {
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>
#include <cassert>
#include <random>

long long int gcd(long long int a, long long int b) {
	return b == 0 ? a : gcd(b, a % b);
}
int main() {
	long long int a, b; std::cin >> a >> b;
	std::cout << a / gcd(a, b) * b << std::endl;
}


Measured memory_bytes: 888
class UnionFind:
    __slots__ = ["_data_size", "_roots"]

    def __init__(self, data_size: int) -> None:
        self._data_size = data_size
        self._roots = [-1] * data_size

    def __getitem__(self, x: int) -> int:
        while self._roots[x] >= 0:
            x = self._roots[x]
        return x

    def is_connected(self, x: int, y: int) -> bool:
        return self[x] == self[y]

    def unite(self, x: int, y: int) -> None:
        x, y = self[x], self[y]
        if x == y:
            return
        if self._roots[x] > self._roots[y]:
            x, y = y, x
        self._roots[x] += self._roots[y]
        self._roots[y] = x


def main():
    import sys

    readline = sys.stdin.readline

    N, Q = map(int, readline().split())
    tree = UnionFind(N)
    res = []
    for _ in range(Q):
        t, u, v = map(int, readline().split())
        if t:
            res.append(int(tree.is_connected(u, v)))
        else:
            tree.unite(u, v)
    print("\n".join(map(str, res)))


if __name__ == "__main__":
    main()


Measured memory_bytes: 18912
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <iomanip>
using namespace std;
int n;
int c[100000];
int used[100000];
vector<pair<int,int> > ch[100000];
void dfs(int now,int col){
	c[now]=col;
	used[now]=1;
	for(int i=0;i<ch[now].size();i++){
		if(used[ch[now][i].first]==0){
			if(ch[now][i].second%2==0){
				dfs(ch[now][i].first,col);
			}else{
				dfs(ch[now][i].first,(col+1)%2);
			}
		}
	}
	return;
}
int main(){
	cin>>n;
	for(int i=0;i<n-1;i++){
		int u,v,w;
		cin>>u>>v>>w;
		u--;v--;
		ch[u].push_back(make_pair(v,w));
		ch[v].push_back(make_pair(u,w));
	}
	dfs(0,0);
	for(int i=0;i<n;i++){
		cout<<c[i]<<endl;
	}
	return 0;
}


Measured memory_bytes: 8704
#include <iostream>
#include <map>
#include <set>

using namespace std;

int main() {
    int N, M;

    cin >> N >> M;

    int H[N + 1];
    map<int, set<int> > load;

    for (int i = 1; i <= N; i++) {
        cin >> H[i];

        set<int> s;
        load.insert(make_pair(i, s));
    }


    for (int i = 0; i < M; i++) {
        int A, B;
        cin >> A >> B;
        load.at(A).insert(B);
        load.at(B).insert(A);
    }

    int ans = 0;

    for(int i = 1; i <= N; i++) {
        int h = H[i];
        set<int> s = load.at(i);
        ans++;
        for(int i : s) {
            if(h <= H[i]) {
                ans--;
                break;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 22960
//Frog-1
#include<bits/stdc++.h>

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define N (ll)(1e7+5)
#define mod (ll)(1e9+7)

using namespace std;

int main()
{
    ll n;cin>>n;
    vector<ll> dp(n),v(n);
    for(auto &x:v)
        cin>>x;
    dp[0] = 0;
    dp[1] = abs(v[1]-v[0]);
    for(ll i=2;i<n;i++)
        dp[i] = min(abs(v[i]-v[i-1])+dp[i-1],abs(v[i]-v[i-2])+dp[i-2]);
    cout<<dp[n-1]<<endl;
    return 0;
}


Measured memory_bytes: 4772
#include<bits/stdc++.h>
using namespace std;
long long Q,H,S,D,N,k;
int main()
{
    cin>>Q>>H>>S>>D>>N;
    k=min(Q*4,min(H*2,S));
    if(k*2<=D)
    {
        cout<<k*N<<endl;
    }
    else
    {
        cout<<((N%2)*k)+N/2*D<<endl;
    }
	return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
num_list=["0"]*n
for i in range(m):
    s,c=map(int,input().split())
    if num_list[s-1]!="0" and num_list[s-1]!=str(c):
        print(-1)
        exit()
    if s==1 and c==0 and n!=1:
        print(-1)
        exit()
    num_list[s-1]=str(c)
if num_list[0]=="0" and n!=1:
    num_list[0]="1"
print(int("".join(num_list)))

Measured memory_bytes: 38384
#include<bits/stdc++.h>
 #include <ext/pb_ds/tree_policy.hpp>
 #include <ext/pb_ds/assoc_container.hpp>
 #include<chrono>
 using namespace std;
 using namespace std::chrono;      
 using namespace __gnu_pbds; 
 #define fastio     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
 #define fi         first
 #define se         second
#define int         long long 
 #define pb         push_back
 #define emp        emplace_back
 #define vv(x)      vector<x>
 #define mp(x,y)    map<x,y>
 #define dq(x)      deque<x>
 #define pql(x)     priority_queue<x>
 #define pqs(x)     priority_queue<x,vv(x),greater<x> >
 #define M          1000000007
 #define forf(i,a,b) for(int i=a;i<b;i++)
 #define it(x)      x::iterator
 #define ll         long long 
 #define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
 #define time__(d)  for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false); debug("%s time : %.4fs", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
 #define vii        vector<int>
 #define big        1e18
 #define sm         -2e9
 #define mkr        make_pair
 #define vpi        vector<pair<int,int> >
 #define pii        pair<int,int>
 #define rng        500005
 #define sz(x)      (int)x.size()
 #define rv(x)      reverse(x.begin(),x.end())
 #define out(x)     cout<<x.fi<<" "<<x.se<<endl;

//#define ordered_set tree<pii, null_type,less<pii>, rb_tree_tag,tree_order_statistics_node_update> 
  
void pr_init()
{
   
    #ifndef ONLINE_JUDGE
    freopen("gin.txt", "r", stdin);
    freopen("gout.txt", "w", stdout);
   
    #endif
}

void solve()
{
 
 string a,b;
 cin >> a >> b;
 
 map<string,int>mp;
 int v1,v2;
 cin >> v1 >> v2;
 mp[a] = v1;
 mp[b] = v2;
 

 string u;
 cin >> u;
 mp[u]--;

 cout<<mp[a]<<" "<<mp[b]<<endl;

}


int32_t main()
{
  //pr_init();
  fastio;
  
  auto start = high_resolution_clock::now(); 
 
  solve();
  auto stop = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop - start); 
   // cout << "Time taken by function: "
   //       << duration.count() << " microseconds" << endl; 

 }
      
      

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

using namespace std;

#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 30

int main(int argc, char const *argv[])
{
	#ifdef DBG
	freopen("A.in", "r", stdin);
	freopen("A.out", "w", stdout);
	#endif

	int people,food;
	int table[MAXN+5];
	int kind,tmp;

	while( ~scanf("%d %d",&people,&food) ){
		memset(table,0,sizeof(table));
		for(int i = 0 ; i < people ; i++ ){
			scanf("%d",&kind);
			for(int j = 0 ; j < kind ; j++ ){
				scanf("%d",&tmp);
				table[tmp]++;
			}
		}
		int ans = 0;
		for(int i = 1 ; i <= food ; i++ )
			if( table[i] == people )
				ans++;
		printf("%d\n",ans );
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ub upper_bound
#define int long long
#define vbe(sdk) sdk.begin(), sdk.end()
#define pb push_back
#define loop(i, a, b) for (int i = a; i < b; ++i)
#define rloop(i, a, b) for (int i = a; i >= b; --i)
#define mp make_pair
#define mod 1000000007
#define endl '\n'
#define vvll vector<vector<int>>
#define vll vector<int>
#define mint map<int, int>
#define arry(x) (int)x.size()
#define sll set<int>
#define pll pair<int, int>
#define F first
#define S second
#define pi 3.14159265358979323846
using namespace std;
const int MAX = 100001;


void solve()
{
        double a,b,c,d;
        cin>>a>>b>>c>>d;
        int q=ceil(a/d);
        int p=ceil(c/b);
      //  cout<<p<<" "<<q<<"\n";
        if(p<=q)
        {
            cout<<"Yes\n";
        }
        else
        {
            cout<<"No\n";
        }
        
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #else
    // // online submission
    // #endif


    int t = 1;
  //  cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}


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

#define ff first
#define ss second
#define ad pair<int,pair<int,int>>  
#define int long long
using namespace std;	

vector<string> a;
int h,wi,k,x1,y11,x2,y2;
bool isValid(int x,int y)
{
	if(x<h && x>=0 && y<wi && y>=0)
			return true;
	return false;
}
int dx[]={0,-1,1,0};
int dy[]={1,0,0,-1};
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	// #ifndef ONLINE_JUDGE 
	// 	freopen("_input.txt", "r", stdin); 
	// freopen("_output.txt", "w", stdout); 
	// #endif 
	cin>>h>>wi>>k;
	cin>>x1>>y11>>x2>>y2;
	//cout<<h<<" "<<wi<<"\n";
	x1--,y11--,x2--,y2--;
	a.resize(h);
	int w[h][wi];
	for(int i=0;i<h;i++)
		for(int j=0;j<wi;j++)
			w[i][j]=LLONG_MAX;
	for(int i=0;i<h;i++)
		cin>>a[i];
	priority_queue<ad,vector<ad>,greater<ad>> pq;
	pq.push({0,{x1,y11}});
	w[x1][y11]=0;
	while(!pq.empty())
	{
		ad pp=pq.top();
		pq.pop();

		int x=pp.ss.ff,y=pp.ss.ss,dist=pp.ff;
		//cout<<x<<" "<<y<<"\n";
		if(x==x2 && y==y2)
		{
			cout<<dist<<"\n";
			return 0;
		}
		for(int i=0;i<4;i++)
		{
			for(int j=1;j<=k;j++)
			{
				int new_x=x+dx[i]*j,new_y=y+dy[i]*j;
				bool f=isValid(new_x,new_y);
				//cout<<new_x<<" "<<new_y<<" "<<f<<"\n";
				if(f && a[new_x][new_y]=='@')
					break;
				if(f)
				{
					if(w[x][y]+1<w[new_x][new_y])
					{
						w[new_x][new_y]=w[x][y]+1;
						pq.push({w[new_x][new_y],{new_x,new_y}});
					}
        			else if(w[x][y]+1>w[new_x][new_y])
                      break;
				}
				else
					break;
			}
		}
	}
	cout<<"-1\n";
}

Measured memory_bytes: 15416
# -*- coding: utf-8 -*-
import math
import sys

num_l = []
mx = 10**9

def get_n(s, k):
  if k == 0:
    if ('3' in s) and ('5' in s) and ('7' in s) and (int(s) <= mx):
      num_l.append(int(s))
  else:
    for c in ['3', '5', '7']:
      get_n(s+c, k-1)
    if len(s) == 0 or s[-1] == '0':
      get_n(s, k-1)

if __name__ == "__main__":
  mx = int(sys.stdin.readline().rstrip())
  get_n("", len(str(mx)))
  print(len(num_l))


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

using namespace std;

int main()
{
  int n;
  cin>>n;
  vector<int>v(n);
  vector<int>c(n);
  for(int i=0;i<n;i++)
  {
      cin>>v[i];
  }
  for(int i=0;i<n;i++)
  {
      cin>>c[i];
  }
  int ans=0;
  for(int i=0;i<n;i++)
  {
      if(v[i]-c[i]>0)
        ans+=v[i]-c[i];
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <string>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug: "<<x<<" "<<y<<endl;
using namespace std;
typedef long long ll;
const int maxn = 105;
const int mod = 1000000007;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n;
  string s;
  cin>>n>>s;
  n%=26;
  for(int i=0;i<s.size();i++){
    int tt = s[i]-'A' + n;
    if(tt>=26)tt-=26;
    s[i] = tt + 'A';
  }
  cout<<s<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = int_fast64_t;
const int mod1 = 1e9 + 7;
const int mod2 = 998244353;
const int inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr)
#define digit(N) cout << fixed << setprecision((N))
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

int N, S, dp[3030][3030];

int main()
{
	cin >> N >> S;
	vector<int> a(N);

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

	dp[0][0] = 1;

	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j <= S; j++)
		{
			if (j + a[i] <= S)
				dp[i + 1][j + a[i]] = (dp[i][j] + dp[i + 1][j + a[i]]) % mod2;
			dp[i + 1][j] = ((2 * dp[i][j]) % mod2 + dp[i + 1][j]) % mod2;
		}
	}
	cout << dp[N][S] << "\n";
}

Measured memory_bytes: 39140
import java.util.Scanner;

/**
 * Created by oka on 2018/06/05.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        if (Math.abs(c - a) <= d || Math.abs(b - a) <= d && Math.abs(c - b) <= d) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


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

int main()
{
    int k,x,i;
    cin>>k>>x;
    for(i=x-k+1; i<=x+k-1; i++)
    {
        if(i!=x+k-1)cout<<i<<" ";
        else cout<<i<<endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <cassert>
#include <random>

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

using namespace std;
typedef long long int ll;
const ll INF = 10000000000;
const double PI = acos(-1);
const ll mod = 1000000007;

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) {
        cin >> a[i];
    }

    ll ans = 0;
    for (int i = 1; i < n; i++) {
        if (a[i] < a[i - 1]) {
            ans += a[i - 1] - a[i];
            a[i] = a[i - 1];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4772
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in range(n):
    res += min(a[i], b[i])
    b[i] = max(0, b[i] - a[i])
    res += min(b[i], a[i + 1])
    a[i + 1] = max(0, a[i + 1] - b[i])
print(res)

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

int main() {
    int n, x, t;
    cin >> n >> x >> t;
    if (n % x == 0) {
        cout << (n / x) * t << endl;
    } else {
        cout << (n / x + 1) * t << endl;
    }
}

Measured memory_bytes: 3552
wrd = [chr(i+97) for i in range(26)]
S = input()
ans = ''
for s in S:
    wrd.remove(s)
wrd.sort()
if(S=='zyxwvutsrqponmlkjihgfedcba'):
    print(-1)
elif(len(S)<26):
    print(S+wrd[0])
else:
    chrs = []
    for i in range(len(S)-1,-1,-1):
        for j in chrs:
            if(j>S[i]):
                ans = S[:i]+j
                break
        else:
            chrs.append(S[i])
            chrs.sort()
            continue
        break

    print(ans)


Measured memory_bytes: 3064
n,d,a=gets.split.map &:to_i
xh=$<.map{|s|s.split.map &:to_i}.sort
s=0
l=0
ans=0
q=[]
xh.map{|x,h|
s-=q.shift[1] while q[0]&&q[0][0]<x
if h-s*a>0
c=(h-s*a-1)/a+1
s+=c
ans+=c
l=x
q<<[l+d*2,c]
end
}
p ans

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

using namespace std;
typedef long long ll;
typedef pair<int,ll> pil;
typedef pair<int,int> pii;
const int maxN = 100010;
const int maxC = 1e6 + 10;
const int INF = 1e9; 
int n,a,b;

int main()
{
	scanf("%d%d%d",&n,&a,&b);
	
	int maxv = min(a,b);
	int minv;
	if(a+b <=n)
	{
		minv = 0;
	}
	else
	{
		minv = (a + b - n);
	}
	cout<<maxv<<" "<<minv<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.math.BigDecimal;
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		stdIn.useDelimiter("\n");
		int n = stdIn.nextInt();
		for(int i = 0; i < n; i++) {
			String pp = stdIn.next();
			pp = pp.replaceAll("Hoshino", "Hoshina");
			System.out.println(pp);
			
		}
		
	}
	public static char[] sorv(String pp) {
		int np1 = 0;
		int np2 = 0;
		int sp1 = 0;
		char[] t = pp.toCharArray();
		char[] m = new char[] {'H','o','s','h','i','n','o'};
		while(t.length > np1) {
			if(t[np1] == m[np2]) {
				np1++;
				np2++;
				if(np1 == m.length-1) {
					t[np1] = 'a';
					sp1++;
					np1 = sp1;
					np2 = 0;
				}
			}
			else {
				sp1++;
				np1 = sp1;
				np2 = 0;
			}
		}
		return t;
		
	}
	
}

Measured memory_bytes: 17372
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, -1, 0, 1 };

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

signed main() {
    int N;
    cin >> N;

    vector<int> A, B;
    inputVector(A, N);
    inputVector(B, N);

    vector<int> cA = A, cB = B;
    sort(all(cA));
    sort(all(cB));
    rep(i, N) {
        if (cA[i] > cB[i]) {
            cout << "No" << endl;
            return 0;
        }
    }

    rep(i, N - 1) {
        if (cA[i] <= cB[i + 1] && cA[i + 1] <= cB[i]) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    map<int, int> mAB, mBA, idxA, idxB;
    rep(i, N) {
        mAB[cA[i]] = cB[i];
        mBA[cB[i]] = cA[i];
        idxA[A[i]] = i;
        idxB[B[i]] = i;
    }

    int now = 0;
    int cnt = 0;
    set<int> visited;
    while (mAB[A[now]] != B[now]) {
        cnt++;
        int targetB = mAB[A[now]];
        int idx = idxB[targetB];
        if (visited.find(idx) != visited.end()) break;
        swap(B[now], B[idx]);
        now = idx;
    }

    if (cnt == N - 1) cout << "No" << endl;
    else cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 28288
object Main extends App {
  val strAry = io.StdIn.readLine().split(' ')
  var five = 0
  var seven = 0
  strAry.foreach{ n =>
    n match {
      case "5" => five = five + 1
      case "7" => seven = seven + 1
    }
  }
  print(if(five == 2 && seven == 1) "YES" else "NO")
}

Measured memory_bytes: 25400
#include<bits/stdc++.h>
#define loop(i, n) for(int i = 0; i < n; i++)
#define pb          push_back
#define ll          long long int
#define vi          vector<int>
#define pi          pair<int, int>
#define W(t)        int t; cin >> t; while(t--)
#define FIO         ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ff          first
#define ss          second
using namespace std;
vi read(int n){
    vi v(n);

    loop(i, n)
        cin >> v[i];
    return v;
}
void solve(){
    ll i, j, k, m, n, ans = 0, cnt = 0, sum = 0;

    cin >> n;

    string s = "ACL";

    string temp;

    loop(i, n){
    	temp += s;
    }
   	cout << temp << "\n";
   

}
int main(){
    FIO
    
    #ifndef ONLINE_JUDGE
	freopen("C:/Codeforces/input.txt", "r", stdin);
	freopen("C:/Codeforces/output.txt", "w", stdout);
	#endif
    
   // W(t)
    solve();
    return 0;
}


Measured memory_bytes: 3616
import sys
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    if i+1 < a[i]:
        print(-1)
        exit()
 
def dfs(x,ans,so):
        if x == n:
                if ans == a:
                        so = so[::-1]
                        for i in so:
                                print(i)
                        exit()
                return 0
        for i in range(len(ans)-1,-1,-1):
            if ans[i] == i+1:
                ans.pop(i)
                so.append(i+1)
                dfs(x+1,ans,so)
                ans.insert(i,i+1)
                so.pop()
        return -1
print(dfs(0,a,[]))      

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define ll long long
#define inf (1LL) << 30
using namespace std;
ll a[110][100010];
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,u;
	cin >> n >> u;
	ll v[n],w[n];
	for(ll i = 0;i < n;i++){
		cin >> w[i] >> v[i];
	}
	for(ll i = 0;i < 110;i++){
		for(ll j = 0;j < 100010;j++){
			a[i][j] = inf;
		}
	}
	a[0][0] = 0;
	for(ll i = 0;i < n;i++){
		for(ll j = 0;j < 100010;j++){
			ll nextw = a[i][j] + w[i];
			if(nextw <= u){
				ll nextv = j + v[i];
				a[i + 1][nextv] = min(a[i + 1][nextv],nextw);
			}
			a[i + 1][j] = min(a[i + 1][j],a[i][j]);
		}
	}
	ll res = 0;
	for(ll i = 0;i < 100010;i++){
		if(a[n][i] <= u){
			res = i;
		}
	}
	cout << res << "\n";
 	return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
 
  for(int i = 0; i < N; i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  int A=0,B=0;
  for(int i = 0; i < N/2; i++){
    A+=a.at(i*2);
    B+=a.at(i*2+1);
  }
  if(N%2==1){
    A+=a.at(N-1);
  }
  cout << A-B << endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {
  private static void execute(ContestReader reader, PrintWriter out) {
    int n = reader.nextInt();
    int m = reader.nextInt();
    out.println((n-1)*(m-1));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


Measured memory_bytes: 20948
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using uint = unsigned int;
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#include"debug_deque.hpp"
#define vector DebugDeque
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printe) FUNC(printw) FUNC(printew) FUNC(printb) FUNC(printd) FUNC(printde);
#endif

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> ds(n);
    for(int i = 0; i < n; i++){
        cin >> ds[i];
    }
    vector<char> dp(1 << 24);
    dp[1] = true;
    for(int i = 0; i < n; i++){
        vector<char> next(1 << 24);
        int d = ds[i];
        if(!d){
            cout << 0 << '\n';
            return 0;
        }
        for(int bits = 0; bits < (1 << 24); bits++){
            if(!dp[bits]){ continue; }
            if((bits >> d & 1) == 0){
                next[bits | (1 << d)] = true;
            }
            if((bits >> (24 - d) & 1) == 0){
                next[bits | (1 << (24 - d))] = true;
            }
        }
        dp.swap(next);
    }
    int ans = 0;
    for(int bits = 0; bits < (1 << 24); bits++){
        if(!dp[bits]){ continue; }
        printb(bits);
        vector<int> v;
        for(int i = 0; i < 24; i++){
            if(bits >> i & 1){
                v.push_back(i);
            }
        }
        prints(v);
        int cand = M;
        for(size_t i = 1; i < v.size(); i++){
            cand = min(cand, abs(v[i] - v[(i - 1)]));
            printd(cand, i);
        }
        cand = min(cand, v[0] + 24 - v.back());
        ans = max(ans, cand);
    }
    cout << ans << '\n';
}


Measured memory_bytes: 33148
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, ll> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 200010;
const int MAXM = 100010;
const int MAXK = 510;
const int MAXQ = 200010;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    ll n, m;
    cin >> n >> m;
    if (n > m) swap(n, m);
    if (n == 1) {
        if (m == 1) cout << 1;
        else cout << max(0LL, m-2);
        return 0;
    }
    cout << (n-2) * (m-2);
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  char s[4];
  char t[4];

  scanf("%s",s);
  scanf("%s",t);

  int n=0;
  for(int i=0;i<3;i++){
    if(s[i]==t[i]) n=n+1;
  }
  printf("%d\n",n);
  return 0;
  
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
typedef long long ll;
ll MOD = 1e9+7;

using namespace std;

ll a[100000];
int amin[100000];//iまでのa[i]の最小値のi
ll m[100000];//iで売ったときの利益の最大値
int mmin[100000];//iで売ったときの買った地点 
vector<int> cheap;//買った地点を集めたもの

int main()
{
	int n;
	ll t;
	ll ans=0;
	
	
	cin>>n>>t;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	//最小値のindexを求める
	amin[0]=0;
	for(int i=1;i<n;i++)
	{
		if(a[i]<a[amin[i-1]])
			amin[i]=i;
		else
			amin[i]=amin[i-1];
	}

	//それぞれの地点における利益の最大値を求める
	for(int i=0;i<n;i++)
	{
		m[i]=a[i]-a[amin[i]];
		mmin[i]=amin[i];
	}

	//合計の利益の最大値を求める
	t=*max_element(m,m+n);
	//合計の利益が最大になる地点の買った位置を求める
	for(int i=0;i<n;i++)
	{
		if(m[i]==t)
		{
			bool f=true;
			for(int j=0;j<cheap.size();j++)
			{
				if(mmin[i]==cheap[j])
				{
					f=false;
					break;
				}
			}
			if(f)
				ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
#include <stdio.h>

int main(void)
{
  long long k, a, b, sum;
  long long gain;
  long long m,n;
  scanf("%llu  %llu %llu",&k, &a, &b); 
  
  gain = b-a;
  
  if ( gain <= 2 ){ 
    printf("%llu", k+1);
    return 0;
  }
  if ( k <= a ){ 
    printf("%llu", k+1);
    return 0;
  }
  n = a-1;
  m = k-n;
  sum = a + (m/2)*gain + (m%2);
  printf("%llu\n",sum);
  return 0;
}


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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int H, W; cin >> H >> W;
	F0R(i, H) F0R(j, W) {
		string S; cin >> S;
		if (S == "snuke") {
			string res;
			res += 'A'+j;
			res += to_string(i+1);
			print(res);
		}
	}
}

Measured memory_bytes: 3724
m=[list(map(int,input().split()))for i in range(3)]
ans=0
if m[0][0]-m[1][0]!=m[0][1]-m[1][1]:
  ans=1
if m[0][0]-m[1][0]!=m[0][2]-m[1][2]:
  ans=1
if m[0][0]-m[2][0]!=m[0][1]-m[2][1]:
  ans=1
if m[0][0]-m[2][0]!=m[0][2]-m[2][2]:
  ans=1
if m[0][0]-m[0][1]!=m[1][0]-m[1][1]:
  ans=1
if m[0][0]-m[0][1]!=m[2][0]-m[2][1]:
  ans=1
if m[0][0]-m[0][2]!=m[1][0]-m[1][2]:
  ans=1
if m[0][0]-m[0][2]!=m[2][0]-m[2][2]:
  ans=1
print("YNeos"[ans::2])

Measured memory_bytes: 3064
// Author: Vamsi Krishna Reddy Satti
// With love for Competitive Programming!
 
#include <bits/stdc++.h>
using namespace std;
 
#define fast_io ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define cout_precision cout.setf(ios::fixed); cout.precision(32);
 
using ll = int64_t; using vll = vector<ll>; using vvll = vector<vll>;
using pll = pair<ll, ll>; using vpll = vector<pll>; using vvpll = vector<vpll>;
using ld = long double;
 
// ------------------------------------------------------------------------------------------------

const ll N_MAX = 40, AB_MAX = 10;
ll n, ma, mb, ans;
ll dp[N_MAX + 1][N_MAX * AB_MAX + 1][N_MAX * AB_MAX + 1];

int main() {
    fast_io; cout_precision;
    cin >> n >> ma >> mb;
    for (ll i = 0; i <= n; i++) {
        for (ll j = 0; j <= N_MAX * AB_MAX; j++) {
            for (ll k = 0; k <= N_MAX * AB_MAX; k++) {
                dp[i][j][k] = INT64_MAX;
            }
        }
    }
    dp[0][0][0] = 0;
    for (ll i = 0, a, b, c; i < n; i++) {
        cin >> a >> b >> c;
        for (ll j = 0; j <= N_MAX * AB_MAX; j++) {
            for (ll k = 0; k <= N_MAX * AB_MAX; k++) {
                if (dp[i][j][k] == INT64_MAX) {
                    continue;
                }
                dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k]);
                dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c);
            }
        }
    }
    ans = INT64_MAX;
    for (ll i = 1; i <= N_MAX * AB_MAX; i++) {
        for (ll j = 1; j < N_MAX * AB_MAX; j++) {
            if (ma * j == mb * i) {
                ans = min(ans, dp[n][i][j]);
            }
        }
    }
    cout << ((ans != INT64_MAX) ? ans : -1) << endl;
}

Measured memory_bytes: 51712
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<list>
#include<map>
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define ll long long

using namespace std;

int main() {
	int k, x;
	cin >> k >> x;
	if (500 * k >= x)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <numeric>
#include <bitset>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
#define FOR(i,a,b)   for(ll i = (a); i < (b); i++ )
#define REP(i, n)    FOR(i,0,n)
typedef pair< ll, ll >   cp2;
typedef pair< ll, cp2 >   cp3;
#define fi first
#define se second
#define sec  se.fi
#define thr  se.se
const ll mod = 1000000007;
//              123456789

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

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

int A[3];
int ans = 3;

int main(){
	
	cin>>A[0]>>A[1]>>A[2];
	
	sort( A, A+3 );
	
	if( A[0] == A[1] ) ans--;
	if( A[1] == A[2] ) ans--;
	
	cout<<ans<<endl;
	
	return 0;

}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
#N, K = map(int, input().split())
N = int(input())
list = []
# 文字列の入力
for i in range(N):
    s = input()
    list.append(s)
    #if not s in list:
        #list.append(s)

#print(list)
print(len(set(list)))


Measured memory_bytes: 35476
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextInt64() int64 {
	i, err := strconv.ParseInt(io.Next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}


func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) PrintLn(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

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

func (io *Io) PrintBool(b bool, trueS, falseS string) {
	if b {
		io.PrintLn(trueS)
	} else {
		io.PrintLn(falseS)
	}
}

func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func absi(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

type Int64s []int64
func (f Int64s) Len() int {
	return len(f)
}
func (f Int64s) Less(i, j int) bool {
	return f[i] < f[j]
}

func (f Int64s) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}


func abcInt(a int) int {
	if a > 0 {
		return a
	} else {
		return -a
	}
}

func gcdInt(a, b int) int {
	for a%b != 0 {
		a, b = b, a%b
	}
	return b
}

var (
	io *Io
)

type P struct {
	s string
	p int
	id int
}

type PS []P
func (f PS) Len() int {
	return len(f)
}
func (f PS) Less(i, j int) bool {
	if f[i].s != f[j].s {
		return f[i].s< f[j].s
	}
	return f[i].p > f[j].p
}

func (f PS) Swap(i, j int) {
	f[i], f[j] = f[j], f[i]
}

func solve() {
	p,q,r := io.NextInt(), io.NextInt(), io.NextInt()

	ans := p+q
	if ans > q+r {
		ans = q+r
	}
	if ans > p+r {
		ans = p+r
	}
	io.PrintLn(ans)
}


func main() {
	io = NewIo()
	f, err := os.Open("src/input")
	if err == nil {
		io.reader = bufio.NewReader(f)
	}
	defer io.Flush()

	solve()
}

Measured memory_bytes: 640
def decode_code(key)
  key = key % 26
  alph = ("a".."z").to_a.join
  trans_code = alph[key..-1] + alph[0..(key-1)]
  return [alph, trans_code]
end

def judge?(str)
  pattern = %w(the this that)

  pattern.each do |v|
    return true if str.include?(v)
  end
  return false
end

while line = gets
  line = line.chomp

  26.times do |i|
    decoded_line = line.tr(*decode_code(i) )
    if judge?(decoded_line)
      puts decoded_line
      break
    end
    puts :Error if i == 25
  end
end

Measured memory_bytes: 6104
#include <cstdio>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define all(a) (a).begin(), (a).end()

using ll = long long;

constexpr int MAX_N = 200010;

ll N;
ll A[MAX_N];

int main()
{
  scanf( "%lld", &N );
  rep( i, N )
    scanf( "%lld", A+i );

  if( A[0] )
  {
    puts("-1");

    return 0;
  }

  rep( i, N-1 ) if( A[i+1]-A[i] > 1 )
  {
    puts("-1");

    return 0;
  }

  ll ans = 0, x = 0;
  for( ll i = N-1; i > 0; --i, --x )
  {
    if( !A[i] )
      continue;

    if( x == A[i] )
      continue;

    ans += A[i];
    x = A[i];
  }

  printf( "%lld\n", ans );

  return 0;
}

Measured memory_bytes: 1664