akhauriyash/Code-Regression huggingface dataset:
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;
const int LEN = 100;

signed main(){
    int a, b;
    cin >> a >> b;
    int c = min(a, b); //false w.
    int d = max(a, b); //true b#

    vector<vector<bool>> ans(LEN, vector<bool>(LEN, false));

    int cnt = 0;
    int i, j;
    i = j = 0;
    for(i = 0; i < LEN; i += 4){
        bool f = false;
        for(j = 0; j < LEN; j += 4){
            if(cnt == c - 1){
                f = true;
                break;
            }
            ans[i][j] = true;
            ans[i][j+1] = true;
            ans[i][j+2] = true;
            ans[i+1][j] = true;
            ans[i+1][j+2] = true;
            ans[i+2][j] = true;
            ans[i+2][j+1] = true;
            ans[i+2][j+2] = true;
            cnt++;
        }
        if(f){
            i += 4;
            break;
        }
    }

    cnt = 0;
    for(; i < LEN; i += 4){
        bool f = false;
        for(j = 0; j < LEN; j += 4){
            if(cnt == d - c + 1){
                f = true;
                break;
            }
            ans[i][j] = true;
            cnt++;
        }
        if(f){
            break;
        }
    }

    if(a > b){
        for(i = 0; i < LEN; i++){
            for(j = 0; j < LEN; j++){
                ans[i][j] = not ans[i][j];
            }
        }
    }

    cout << 100 << " " << 100 << endl;
    for(i = 0; i < LEN; i++){
        for(j = 0; j < LEN; j++){
            if(ans[i][j]){
                cout << '#';
            }else{
                cout << '.';
            }
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ans=0,l=0;
  int n8[100];
  int podd[15]={3,5,7,11,13,17,19,21,23,29,31,37,41,43,47};
  for(int i=0;i<15;i++){
    for(int j=i+1;j<15;j++){
      for(int k=j+1;k<15;k++){
	if(podd[i]*podd[j]*podd[k]<=200){
	  n8[l]=podd[i]*podd[j]*podd[k];
	  l++;
	}
      }
    }
  }
  for(int i=0;i<15;i++){
    for(int j=i+1;j<15;j++){
      if(podd[i]*podd[i]*podd[i]*podd[j]<=200){
	n8[l]=podd[i]*podd[i]*podd[i]*podd[j];
	l++;
      }
    }
  }
  cin>>n;
  for(int i=1;i<=n;i+=2){
    for(int j=0;j<=l;j++){
      if(i==n8[j]) ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}
  

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define rep(i,n) FOR(i,0,n-1)
#define int long long
#define MOD 998244353
#define MAXN  100005
#define P pair<int,int>

char f[10][10];
int dh[2] = {0,-1},dw[2] = {-1,0};
signed main(){
	
	int h,w;cin>>h>>w;
	int cnt = 0;
	rep(i,h)rep(j,w)
	{
		char s;cin>>s;
		if(s == '#') cnt++;
	}
	
	if(cnt == h+w-1)	cout << "Possible" << endl;
	else cout <<"Impossible" << endl;
	return 0;
	
	
}

//cout << ans << endl;

Measured memory_bytes: 256
a=list(map(int,input().split()))
if a[2]-a[4] < 0:
    print("No")
elif a[2]+a[4] > a[0]:
    print("No")
elif a[3]+a[4] > a[1]:
    print("No")
elif a[3]-a[4] < 0:
    print("No")
else:
    print("Yes")


Measured memory_bytes: 5596
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
char a[105],b[105],c[105];
int main()
{
	int n;scanf("%d",&n);
	scanf("%s%s%s",a+1,b+1,c+1);int sum=0;
	for(int i=1;i<=n;++i) {
		if(a[i]==b[i]&&b[i]==c[i]) continue;
		else if((a[i]==b[i])^(b[i]==c[i])^(a[i]==c[i])) sum++;
		else if(a[i]!=b[i]&&b[i]!=c[i]&&c[i]!=a[i]) sum+=2;
	}printf("%d",sum);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
const int MAX_V=1e+5+10;
const int INF=1<<29;

struct edge{int to,cap,rev;};

vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];

void add_edge(int from,int to,int cap){
  G[from].push_back((edge){to,cap,(int)G[to].size()});
  G[to].push_back((edge){from,0,(int)G[from].size()-1});
}
void bfs(int s){
  memset(level,-1,sizeof(level));
  queue<int> que;
  level[s]=0;
  que.push(s);
  while(!que.empty()){
    int v=que.front();que.pop();
    for(int i=0;i<(int)G[v].size();i++){
      edge &e=G[v][i];
      if(e.cap>0&&level[e.to]<0){
	level[e.to]=level[v]+1;
	que.push(e.to);
      }
    }
  }
}
int dfs(int v,int t,int f){
  if(v==t)return f;
  for(int &i=iter[v];i<(int)G[v].size();i++){
    edge &e=G[v][i];
    if(e.cap>0&&level[v]<level[e.to]){
      int d=dfs(e.to,t,min(f,e.cap));
      if(d>0){
	e.cap-=d;
	G[e.to][e.rev].cap+=d;
	return d;
      }
    }
  }
  return 0;
}

int max_flow(int s,int t){
  int flow=0;
  for(;;){
    bfs(s);
    if(level[t]<0)return flow;
    memset(iter,0,sizeof(iter));
    int f;
    while((f=dfs(s,t,INF))>0){
      flow+=f;
    }
  }
}

int main(){
  int v,e,from,to,cap;cin>>v>>e;
  REP(i,e){
    cin>>from>>to>>cap;
    add_edge(from,to,cap);
  }
  cout<<max_flow(0,v-1)<<endl;
}

Measured memory_bytes: 6300
import java.util.Scanner;

public class Main {
	public static void main (String args[]) {
		Scanner sc = new Scanner(System.in);
		int n;
		int a[][];
		int b[];
		int c[];
		int d;

		while (true) {
			n = sc.nextInt();
			d = 0;
			if (n == 0) {
				break;
			}
			a = new int[n][n];
			b = new int[n];
			c = new int[n];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					a[i][j] = sc.nextInt();
					b[i] += a[i][j];
					c[j] += a[i][j];
					d += a[i][j];
				}
			}
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < n; j++) {
					System.out.printf("%5d", a[i][j]);
				}
				System.out.printf("%5d", b[i]);
				System.out.println();
			}
			for (int i = 0; i < n; i++) {
				System.out.printf("%5d", c[i]);
			}
			System.out.printf("%5d\n", d);
		}
	}
}

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

using namespace std;
typedef long long ll;

#define MOD (long long)(1e9+7)
#define INF (1LL<<60)
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define rep1(i,n) for(ll i = 1; i <= (n); i++)

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


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

// mod m における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;
}

// 素因数分解
vector<pair<ll, ll>> prim;
void pf(ll n)
{
  ll s = sqrt(n);
  ll r = 0;
  for(ll i = 2; i <= s; i++) {
    if((n % i) == 0) {
      r = 0;
      do {
	r++;
	n = n / i;
      } while((n % i) == 0);
      prim.push_back({i, r});
    }
  }
  if(n > s) {
    prim.push_back({n, 1});
  }
}

void solve()
{
  ll N, M; cin >> N >> M;
  vector<ll> x(M), y(M); rep(i, M) cin >> x[i] >> y[i];
  ll ans = 0;

  vector<ll> cnt(N, 1);
  vector<bool> red(N, false);
  red[0] = true;

  rep(i, M) {
    x[i]--;y[i]--;
    cnt[x[i]] --;
    cnt[y[i]] ++;
    if(red[x[i]]) red[y[i]] = true;
    if(cnt[x[i]] == 0) red[x[i]] = false;
  }
  rep(i, N) ans += red[i] ?  1 : 0;
  
  cout << ans << endl;
}


int main(void)
{
  // ll t; cin >> t; rep(i, t)
  solve();
}


Measured memory_bytes: 5464
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define distance(x1,y1,x2,y2) sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("yes");
	else say("no");
}

void Yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

template<typename T>
void maxi(T & a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T & a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

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

int main() {
	makei(n);
	makei(k);
	YN(k <= (n / 2 + n % 2));
}

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

int gcd(int a, int b) {
    if (b == 0) return a;
    else return gcd(b, a%b);
}

int main() {
    int K;
    int g;
    long long ans = 0;
    cin >> K;
    for (int a=1; a<=K; a++) {
        for (int b=1; b<=K; b++) {
            g = gcd(a,b);
            for (int c=1; c<=K; c++) {
                ans += gcd(g,c);
            }
        }
    }

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


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define ll long long int
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define println(x) cout << x << endl;
using namespace std;
int main()
{
    string n;
    cin >> n;
    rep(i, n.size()) {
        cout << (n[i] == '1' ? 9:1);
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
int v[300000],f[300000];
int main()
{
  int n,m;
  cin>>n>>m;
  for(int i=0;i<n;++i){
    cin>>v[i];
  }
  for(int i=0;i<m;++i){
    int a,b;
    cin>>a>>b;
    a--,b--;
    if(v[a]>v[b]){
      f[b]=1;
    }
    else if(v[a]<v[b]){
      f[a]=1;
    }
    else{
      f[a]=f[b]=1;
    }
  }
  int ans=0;
  for(int i=0;i<n;++i){
    if(f[i]==0)ans++;
  }
  cout<<ans;
}

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

struct ipair {int a, b; };


int main(){
    int n;
    long long k;
    long long sum=0;
    scanf("%d%lld", &n, &k);
    vector<ipair> p(n);

    for (int i = 0; i < n; i++)
    {
        scanf("%d%d", &p.at(i).a, &p.at(i).b);
    }

    //aをキーとして、昇順にソートする
    sort(p.begin(), p.end(), 
    [](const ipair& x, const ipair& y) { return x.a < y.a;} );

    for (int i = 0; i < n; i++)
    {
        sum += p.at(i).b;
        if (sum >= k) 
        {
            printf("%d\n", p.at(i).a);
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 1024
# https://atcoder.jp/contests/abc102/tasks/arc100_b

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop

def main():
    n = int(input())
    al = list(map(int, input().split()))

    l, c, r = 1, 2, 3
    P = sum(al[:l])
    Q = sum(al[l:c])
    R = sum(al[c:r])
    S = sum(al[r:])

    ans = max(P, Q, R, S) - min(P, Q, R, S)

    while c <= n - 2:
        while True:
            if abs(P - Q) < abs((P + al[l]) - (Q - al[l])):  # これ以上差が縮まらないなら break
                break

            if l == c - 1:
                break

            P += al[l]
            Q -= al[l]
            l += 1

        while True:
            if abs(R - S) < abs((R + al[r]) - (S - al[r])): # これ以上差が縮まらないなら break
                break
            if r == n - 1:
                break

            R += al[r]
            S -= al[r]
            r += 1

        ans = min(max(P, Q, R, S) - min(P, Q, R, S), ans)

        # center を一つ右に進める
        Q += al[c]
        R -= al[c]
        c += 1

    print(ans)

if __name__ == '__main__':
    main()


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

int main()
{
	int a, b, c;
	
	cin >> a >> b >> c;
	
	if (b > a && b > c) swap(c, b);
	
	if (a > c && a > b) swap(a, c);
	
	if (a > b) swap(a, b);
	
	cout << a << " " << b << " " << c;
	
	cout << endl;
	return 0;
}


Measured memory_bytes: 3108
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <queue>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define all(x) (x).begin(), (x).end()

int main() {
    int n;
    cin>>n;
    vector<pair<int,int>>a(n);
    rep(i,n)cin>>a[i].first>>a[i].second;
    vector<int>j(n),k(n);
    rep(i,n){
        j[i]=a[i].first+a[i].second;
        k[i]=a[i].first-a[i].second;
    }
    sort(all(j));
    sort(all(k));
    cout<<max(j[n-1]-j[0],k[n-1]-k[0]);
	return 0;
}


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

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using mii = map<int, int>;
using mll = map<ll, ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vpi = vector<pii>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpl = vector<pll>;
using vs = vector<string>;

int main()
{
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    if(k < a) cout << k << endl;
    else if(k <= a+b) cout << a << endl;
    else cout << a - (k - a - b) << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>

using namespace std;

typedef long long ll;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;

#define debug(x) cout << #x << " = " << (x) << endl;
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;

int n;
int A[1<<20];

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);

 ios_base::sync_with_stdio(false);
 cin.tie(NULL);
 cin>>n;
 int x = 0;
 for(int i = 1;i <= n;i++) {
   x = (10*x + 7) % n;
   if(x == 0) {cout<<i;return 0;}
   if(A[x]) {cout<<-1;return 0;}
   A[x] = 1;
 }

 return 0;
}


Measured memory_bytes: 7532
#include<bits/stdc++.h>
using namespace std;
bool flag[104];
set<int>st;

int main()
{
    int n,x,a,i,ans;
    cin>>x>>n;
    for(i=0; i<n; i++)
    {
        cin>>a;
        flag[a]=true;
    }
    for(i=-102;i<1;i++)st.insert(i);
    for(i=1; i<=102; i++)
    {
        if(!flag[i])st.insert(i);
    }
    auto it=st.lower_bound(x);
    ans=*it-x,a=*it;
    if(it!=st.begin())
    {
        it--;
        if(abs(*it-x)<=ans)a=*it;
    }
    cout<<a<<endl;
    return 0;
}


Measured memory_bytes: 3652
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N)) + 1):
    a = n
    if N % n != 0:
        continue
    b = int(N / n)
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Measured memory_bytes: 3060
package main

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

func main() {
	A, _ := ReadInt(), ReadInt()
	S := []byte(ReadString())
	if S[A] != '-' {
		fmt.Println("No")
		return
	}
	l, r := S[:A], S[A+1:]
	if allDigit(string(l)) && allDigit(string(r)) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

func allDigit(s string) bool {
	for i := 0; i < len(s); i++ {
		if s[i] < '0' || '9' < s[i] {
			return false
		}
	}
	return true
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1840
#include<bits/stdc++.h>
using namespace std;
long long f[100101];
void ini(long long m)
{
    f[0]=1;
    for(long i=1;i<100101;i++)
    f[i]=(f[i-1]*i)%m;
}
long long po(long long a,long long b,long long m)
{
    long long res=1;
    while(b>0)
    {
        if(b%2==1)
        res=(res*a)%m;
        b=b/2;
        a=(a*a)%m;
    }
    return res;
}
long long inv(long long f,long long p)
{
    return po(f,p-2,p);
}
long long choose(long long n,long long k,long long m)
{
    if(n<k)
    return 0;
    else
    {
    long long num=f[n];
    long long inv1=inv(f[n-k],m);
    num=(num*inv1)%m;
    inv1=inv(f[k],m);
    num=(num*inv1)%m;
    return num;
    }
    
}
int main()
{
int n,k;

cin>>n>>k;
long long int a[n];
long long m=1000000007;
ini(m);
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
//long sum[n];
//for(int i=0;i<n;i++)
//{
 //   if(i==0)
  //  sum[i]=a[i];
  //  else
  //  sum[i]=a[i-1];
//}
long long ans=0;
//cout<<ans<<endl;
for(int i=0;i<n;i++)
{
  if(a[i]<0)
    a[i]=(a[i]+m)%m;
if(i>=k-1 && i<(n-(k-1)))
{
    long long a1=(choose(n-1-i,k-1,m)*(-a[i]+m)%m)%m;
    long long b1=(choose(i,k-1,m)*(a[i])%m)%m;
    //cout<<a1<<" "<<n-1-i<<endl;
   // cout<<b1<<" "<<i<<endl;
    //cout<<a1+b1<<endl;
   // cout<<" p "<<endl;
     ans=(ans+(a1+b1)%m)%m;
}
else if(i<k-1)
{
    long long a1=(choose(n-1-i,k-1,m)*(-a[i]+m)%m)%m;
    //cout<<a1<<endl;
  //  cout<<ans<<" "<<a1<<" "(ans+a1)<<" gogo "<<endl;
    ans=(ans+a1)%m;
    //cout<<" p 1"<<endl;
    
}
else if(i>=k-1)
{
    //cout<<i<<" "<<k<<endl;
      long long b1=(choose(i,k-1,m)*(a[i])%m)%m;
      ans=(ans+b1)%m;
     // cout<<" pj "<<endl;
}
//cout<<a[i]<<" "<<i<<" ans "<<ans<<endl;
}
cout<<ans<<endl;
return 0;
}


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

#define not_minus x - r >= 0 && y - r >= 0
#define not_fit x + r <= w && y + r <= h

int main() {
	int w, h, x, y, r;
	cin >> w >> h >> x >> y >> r;
	if (not_minus && not_fit) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 3104
n = gets.chomp.to_i
ans = 0

ary357 = ['3','5','7']

# 3...9桁を考える上で、iとaryに対して、
# aryがi個入った配列を返してくれるメソッドが欲しくなりました
def retarys(int, ary)
  retary = []
  int.times {retary << ary}
  retary
end

# ３桁と同じことを繰り返すだけです。*で配列を展開して渡せることを利用して、
# retarysという自家製メソッドでi個ary357を渡してます。
2.step(8){|i|
  # ary357.product(*retarys(i,ary357))　でi+1桁の3,5,7からなる整数を全列挙してます
  # count は trueの数を返してくれる便利な子です。
  ans += ary357.product(*retarys(i,ary357)).count {
    |aa| (aa.uniq.size == 3) && (aa.inject(:+).to_i <= n)
  }
}
puts ans

Measured memory_bytes: 5116
import sys
sys.setrecursionlimit(500000)

N = int(input())
E = [[] for _ in range(N+1)]
for i in range(N-1):
    a, b = map(int, input().split())
    E[a].append((b, i))
    E[b].append((a, i))
K = max(len(e) for e in E)
print(K)

ans = [-1] * (N-1)
def dfs(v=1, p=0, p_col=-1):
    col = 1
    for u, idx in E[v]:
        if u!=p:
            if col == p_col:
                col += 1
            ans[idx] = col
            dfs(u, v, col)
            col += 1
dfs()
print("\n".join(map(str, ans)))


Measured memory_bytes: 85652
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};

int main(){
    ll n, m;
    cin >> n >> m;
    vector<vector<ll>> c(1020000);
    for(ll i = 0; i < n; i++) {
        ll a, b;
        cin >> a >> b;
        c[a].push_back(b);
    }
    ll ans = 0;
    priority_queue<ll> q;
    ll count = 0;
    for(ll i = 1; i <= m; i++){
        for(ll j = 0; j < c[i].size(); j++){
            q.push(c[i][j]);
            //cout << c[i][j] << endl;
        }
        if(q.empty()) continue;
        ll a = q.top();
        ans+=a;
        q.pop();
    }
    cout << ans << endl;
    return 0;
}



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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  string s;
  cin>>s;
  cout << (700 + 100*count(ALL(s),'o')) << endl;
  return 0;
}


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

int main() {
  char c;
  cin >> c;
  string anser;
  
  if(c == 'a'){
    anser = "vowel";
  }
  else if(c == 'i'){
    anser = "vowel";
  }
  else if(c == 'u'){
 	anser = "vowel";
  }
  else if(c == 'e'){
 	anser = "vowel";
  }
  else if(c == 'o'){
 	anser = "vowel";
  }else  {
   anser = "consonant";
  }
 
  cout << anser << endl;
}

Measured memory_bytes: 256
/*
	Created by Faisal Ahmed
*/

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
typedef long double ld;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(NULL);
	
	string str;
	
	cin >> str;
	
	int n = str.size(), ans = 0;
	for(int i = 0, j = n - 1; i <= j; i++, j--){
		if(str[i] != str[j]){
			ans++;
		}
	}
	
	cout << ans << endl;
	
	return 0;
} 

Measured memory_bytes: 256
#include<stdio.h>

void swap(int *xp, int *yp)
{
    int temp = *xp;
    *xp = *yp;
    *yp = temp;
}

void bubbleSort(int arr[], int n)
{
   int i, j;
   for (i = 0; i < n-1; i++)
       for (j = 0; j < n-i-1; j++)
           if (arr[j] < arr[j+1])
              swap(&arr[j], &arr[j+1]);
}


void printArray(int arr[], int size)
{
    int i;
    for (i=0; i < size; i++)
        printf("%d\n", arr[i]);
}


int main()
{
    int arr[10];
    for(int i=0; i<10; i++)
        scanf("%d", &arr[i]);
    int n = 10;
    bubbleSort(arr, n);
    printArray(arr, 3);
    return 0;
}

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

public class Main {

   static List<Integer> al[];
    private  static void solver(InputReader sc, PrintWriter out) {
       int n  = sc.nextInt();
       int m = sc.nextInt();
       long ans = (m * (m-1)) /2  ;
       ans += (n*(n-1))/2;
       out.println(ans);
    }

    public static void main(String[] args) throws Exception{
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

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

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

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong(){
            return Long.parseLong(next());
        }

        public long[] readLongArr(int n){
            long arr[] = new long[n];
            for(int i=0; i<n; i++){
                arr[i] = nextLong();
            }
            return arr;
        }
        public int[] readIntArr(int n){
            int arr[] = new int[n];
            for(int i=0; i<n; i++){
                arr[i] = nextInt();
            }
            return arr;
        }
    }
}


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

int main()
{
    int a, b, i, t, count=0;
    cin>>a>>b;

    if(b<a)
    {
        t = a;
        a = b;
        b = t;
    }

    for(i=a; i<=b; i++)
    {
        if(a*b*i % 2 != 0)
        {
            count++;
            break;
        }
    }
    if(count == 0)
        cout<<"No";
    else
        cout<<"Yes";
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>

int main() {
    long long N, A, B, C, D, E;
    std::cin >> N >> A >> B >> C >> D >> E;

    const auto min_val = std::min({A, B, C, D, E});
    const auto ret = (N + min_val - 1) / min_val + 4;
    
    std::cout << ret << std::endl;
}


Measured memory_bytes: 256
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = getLine >>= putStrLn . which "Yes" "No" . all even . map length . group . sort


Measured memory_bytes: 508
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
long n,x[1000],y[1000];
vector<long>d;
main(){
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i];
		if(abs(x[i])+abs(y[i])&1^abs(x[0])+abs(y[0])&1){
			cout<<-1<<endl;
			return 0;
		}
	}
	for(int i=31;i--;)d.push_back(1<<i);
	d.push_back(1);
	d.push_back(1);
	if(abs(x[0])+abs(y[0])&1^1)d.push_back(1);
	cout<<d.size()<<endl;
	for(int i=0;i<d.size();i++)cout<<d[i]<<(i+1==d.size()?"\n":" ");
	for(int i=0;i<n;i++){
		long X=x[i],Y=y[i];
		string s="";
		for(int j=0;j<d.size();j++)s+=abs(X)>abs(Y)?X>0?X-=d[j],"R":(X+=d[j],"L"):Y>0?Y-=d[j],"U":(Y+=d[j],"D");
		cout<<s<<endl;
	}
}

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

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

using namespace std;

int main(){
	int a,b,c; cin>>a>>b>>c;
	cout<<(a+b==c||b+c==a||c+a==b?"Yes":"No")<<endl;

	return 0;
}


Measured memory_bytes: 256
from collections import deque
from collections import defaultdict
n =int(input())
# a = list(map(int, input().split()))
# n,m = map(int, input().split())
# b = [int(input()) for _ in range(n)]

amari = n%10

if amari ==3:
    print("bon")
elif amari == 0 or amari == 1 or amari ==6 or amari ==8:
    print("pon")
else:
    print("hon")


Measured memory_bytes: 9464
# editorial
N = int(input())

from functools import lru_cache
@lru_cache(maxsize=1000)
def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if  all(s.count(c) for c in "753") else 0
    for c in "753": #文字列数値をforで回すときの書き方！ 覚える
        ret += dfs(s+c) #pythonなのでそのまま+できる
    return ret

print(dfs("0"))

Measured memory_bytes: 3988
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(n);++i)
const int INF =1001001001;
using ll=long long;
using P = pair<int,int>;
using Graph =vector<string>;
Graph field;
queue<P> q;

int main() {
  ll n;
  ll sum=0;
  cin>>n;
  ll a[1000000];
  rep(i,n){
    ll ab;
    cin>>ab;
    a[ab]++;
    sum+=ab;
  }
  ll q;
  queue<ll> que;
  cin>>q;
  rep(i,q){
    ll b,c;
    cin>>b>>c;
    a[c]+=a[b];
    sum+=(c-b)*a[b];
    a[b]=0;
    que.push(sum);
  }
  while(!que.empty()){
    cout<<que.front()<<endl;
    que.pop();
  }
}


Measured memory_bytes: 5164
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>



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

using namespace std;
int a,b,c;
int k1,k2,k3;

int main(){
  cin >> a >> b >> c;
  k1 = a*10 + b + c;
  k2 = a + b*10 + c;
  k3 = a + b + c*10;
  int ans = -10;
  ans = max(k1,k2);
  ans = max(ans, k3);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define s(a, x, y) sort(a.begin()+x, a.begin()+y);
#define mp make_pair
#define F first
#define S second
#define ll long long
using namespace std;
ll a, b, c, d, e;
int main() {
	for(int i=0; i<5; i++){
		cin>>a;
		if(a==0) cout<<i+1;
	}
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int N;

void solve() {
    cin >> N;
    ll A[N];
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    vector<vector<ll>> dp(N+1, vector<ll>(2, 0));
    dp[0][1] = -1e11;
    for (int i = 0; i < N; ++i) {
        ll a = A[i];
        dp[i+1][0] = max(dp[i][0] + a, dp[i][1] - a);
        dp[i+1][1] = max(dp[i][0] - a, dp[i][1] + a);
    }
    cout << dp[N][0] << endl;
}

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


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

int main(){
	int x,y;
	cin >> x >> y;
	while(!(x == 0 && y == 0 )){
		if(x<y) cout << x << " " << y << endl;
		else cout << y << " " << x << endl;
			cin >> x >> y;
	}
	return 0;
}



Measured memory_bytes: 3084
n, x =  map(int, input().split())
dat = list(map(int, input().split()))
dat.append(x)
dat.sort()
dist = []
cur = dat[0]
for i in range(1, len( dat)):
    dist.append(dat[i] - cur)
    cur = dat[i]
#print(dist)

res = 0
import fractions
for i in range(len(dist)):
    res = fractions.gcd(res, dist[i])

print(res)

Measured memory_bytes: 82836
s,t=list(input()),list(input())
length_s,length_t=len(s),len(t)

flag=0
for i in reversed(range(length_s-length_t+1)):
    word=s[i:i+length_t]
    cnt=0
    for j in range(length_t):
        if word[j]==t[j] or word[j]=="?":
            cnt +=1
        if cnt==length_t:
            flag=1
            s[i:i+length_t]=t
    if flag==1:break
    
s="".join(s).replace("?","a")
print(s if flag else "UNRESTORABLE")

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
    int A=0, B=0, C=0;//A is 500 yen, B is 100 yen, C is 50 yen
    int X=0, count=0;

    scanf("%d",&A);
    scanf("%d",&B);
    scanf("%d",&C);
    scanf("%d",&X);

    for(int i=0;i<A+1;i++){
        for(int j=0;j<B+1;j++){
            for(int k=0;k<C+1;k++){
                int temp = 500*i + 100*j + 50*k;
                if(temp == X) count++;
            }
        }
    }

    printf("%d",count);

}

Measured memory_bytes: 128
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
const int N=505;
char s[N][N];int vis[N],mm[N],n,res,cnt,fl;
int main(){
	scanf("%d",&n);
	fp(i,1,n)scanf("%s",s[i]+1);
	fp(i,1,n)fp(j,1,n)if(s[i][j]=='#')fl=1,vis[j]=1,++mm[j];
	if(!fl)return puts("-1"),0;
	fp(i,1,n)mm[i]=(mm[i]==n?1:0),cnt+=mm[i];
	res=233333;
	fp(i,1,n){
		R int c=0;
		fp(j,1,n)c+=s[i][j]=='.';
		cmin(res,n-cnt+c+(vis[i]^1));
	}
	printf("%d\n",res);
	return 0;
} 

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

int main(){
    ll n, a, b; cin >> n >> a >> b;
    ll p = n/(a+b);
    ll ans ;
    ans = p * a + min(a, n%(a+b));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//namespace mp=boost::multiprecision;
//#define mulint mp::cpp_int
//#define mulfloat mp::cpp_dec_float_100
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
//constexpr int MOD=1000000007;
constexpr int MOD=998244353;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcountll(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;
//struct edge{lint to,num;};
//vector<int> bucket[MAX_N/1000];

lint ans[MAX_N];

void calc(int r,int l,int now){
    if((r+l)%2){
        if(r%2){
            ans[now-1]=(r+l+1)/2;
            ans[now]=(r+l)/2;
        }
        else{
            ans[now]=(r+l+1)/2;
            ans[now-1]=(r+l)/2;
        }
    }
    else{
        ans[now-1]=(r+l)/2;
        ans[now]=(r+l)/2;
    }
}

int main(void){
    string S;
    cin >> S;
    int N=S.length();
    int l=0,r=0,mid=0;
    rep(i,N){
        if(S[i]=='R'){
            if(l!=0){
                calc(r,l,mid);
                r=1,l=0;
            }
            else r++;
            if(i<N-1) if(S[i+1]=='L') mid=i+1;
        }
        else l++;
    }
    if(r+l!=0) calc(r,l,mid);
    rep(i,N) cout << ans[i] << " ";
    cout << endl;
}

Measured memory_bytes: 4496
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#define nmax_def 110000
#define Cmax_def 2200
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main() {
	int N;
	vector<vi> s;
	cin >> N;
	rep(i, N) {
		string si;
		cin >> si;
		vi s_int;
		rep(j, 10) {
			s_int.push_back((int)si[j]);
		}
		sort(s_int.begin(), s_int.end(), less<int>());
		s.push_back(s_int);
	}
	sort(s.begin(), s.end(), less<vi>());

	ll ans = 0;
	ll count = 1;
	rep(i, N - 1) {
		if (s[i] == s[i + 1]) {
			count++;
		}
		else {
			ans += count * (count - 1) / 2;
			count = 1;
		}
	}
	ans += count * (count - 1) / 2;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7856
#include<stdio.h>
int main(void)
{
  int fund, mod, num, i, j=1;
  scanf("%d%d%d", &fund, &mod, &num);
  for(i=1; i<=mod; i++)
  {
    if((fund*i)%mod==num) j=0;
  }
  if(j==0) printf("YES");
  else printf("NO");
  return 0;
}

Measured memory_bytes: 128
#coding:utf-8

N,M = map(int,input().split())
List = sorted([list(map(int,input().split())) for i in range(M)], key=lambda x:x[1])

cnt = 1
maxa = 0
b = List[0][1]
for i in range(1,M):
    newB = List[i][1]
    maxa = max(maxa,List[i][0])
    if newB > b:
        if maxa >= b:
            cnt += 1
            b = newB
        maxa = 0
        
print(cnt)


Measured memory_bytes: 29848
#include <iostream>
#include <string>

using namespace std;

int main() {
    string str;
    cin >> str;
    string codeFestival = "CODEFESTIVAL2016";
    int count = 0;
    for(int i = 0; i < str.length(); i++) {
        if(str[i] != codeFestival[i]) count++;
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
n = gets.chomp
n = n.split("")
l = n.count/2
if n.count%2==1
  k = n[0..l-1]
  m = n[l+1..n.count-1].reverse!
  count = 0
  i = 0
  for i in 0..l-1 do
    if k[i] != m[i]
      count += 1
    end
    i += 1
  end
  p count
else
  k = n[0..l-1]
  m = n[l..n.count-1].reverse!
  count = 0
  i = 0
  for i in 0..l-1 do
    if k[i] != m[i]
      count += 1
    end
    i += 1
  end
  p count
end


Measured memory_bytes: 1788
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  GODSPEED       ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define  f              first                 
#define  s              second
#define  newl           cout<<"\n";
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<"\n";
#define  deb2(a,b)      cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());
#define  all(a)         a.begin(),a.end()           
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   N     =  2e5+5;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;
const ll   LEVEL =  log2(N)+1;

ll a, b, c, d;

void solve(){
	cin >> a >> b >> c >> d;
	ll ans = max({a*c, b*d, a*d, b*c});
	deb1(ans)
}

int main(){
	GODSPEED;
	int test = 1;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
	#ifndef ONLINE_JUDGE
	cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif
}

Measured memory_bytes: 3644
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;

#define ll long long

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
ll MIN(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

ll gcd(ll a, ll b) {

	if (a < b) {

		ll tmp = a;
		a = b;
		b = tmp;

	}
	if (a%b == 0)return b;
	return gcd(b, a%b);

}
//最大公約数

ll lcm(ll a, ll b) {

	return a / gcd(a, b)*b;

}
//最小公倍数

int main() {

	int H, W, a, b;
	string S[300][300];

	cin >> H >> W;
	for (int i = 1; i <= H; i++) {
		for (int j = 'A'; j <= 'A' + W - 1; j++) {
			cin >> S[i][j];
			if (S[i][j] == "snuke") {
				a = i;
				b = j;
			}
		}
	}
	cout << (char)b << a << endl;

	return 0;
}

Measured memory_bytes: 1024
// We can see L in binary representation!

#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;

int main() {
	#ifdef kvutxdy
	freopen("C:/Users/khanh/OneDrive/RoadtoPurple/Code/Codeforces/input.in", "r", stdin);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int L;
	cin>>L;
	int n=32-__builtin_clz(L);
	int k=1;
	vector<tuple<int,int,int>> res;
	for(int i=1;i<n;++i){
		res.emplace_back(i,i+1,0);
		res.emplace_back(i,i+1,k);
		k<<=1;
	}
	for(int i=19;i>=0;--i)
		if((L>>i&1)&&(L>=(1<<(i+1)))){
			res.emplace_back(i+1,n,k);
			k+=1<<i;
		}
	cout<<n<<' '<<(int)res.size()<<'\n';
	for(auto i:res){
		int u,v,c;
		tie(u,v,c)=i;
		cout<<u<<' '<<v<<' '<<c<<'\n';
	}
}

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

int main() {
  int64_t a, b, c, k;
  cin >> a >> b >> c >> k;

  if (a + b >= k) {
    if (a >= k) {
      cout << k << endl;
    } else {
      cout << a << endl;
    }
  } else {
    cout << a - (k - (a + b)) << endl;
  }
}


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

using namespace std;

string S;

int main()
{
  cin >> S;
  string s1 = S;
  int r1 = 0;
  int r2 = 0;
  for (int i = 0; i < S.length() - 1; i++)
  {
    if (!(S[i] == '0' && S[i + 1] == '1') && !(S[i] == '1' && S[i + 1] == '0'))
    {
      if (S[i] == '0')
        S[i + 1] = '1';
      else
        S[i + 1] = '0';
      r1++;
    }
  }
  // cout << S << endl;
  S = s1;
  for (int i = S.length() - 1; i > 0; i--)
  {
    if (!(S[i] == '0' && S[i - 1] == '1') && !(S[i] == '1' && S[i - 1] == '0'))
    {
      if (S[i] == '0')
        S[i - 1] = '1';
      else
        S[i - 1] = '0';
      r2++;
    }
  }

  // cout << S << endl;

  cout << min(r1, r2);
}

Measured memory_bytes: 512
// This code wrote by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
using namespace std;
template <class t> inline void read(t &s)
{
	s=0;
	reg int f=1;
	reg char c=getchar();
	while(!isdigit(c))
	{
		if(c=='-')
			f=-1;
		c=getchar();
	}
	while(isdigit(c))
		s=(s<<3)+(s<<1)+(c^48),c=getchar();
	s*=f;
	return;
}
bool vis[1050];
signed main(void)
{
	ios::sync_with_stdio(false);cin.tie(0);
	int n,k;
	cin>>n>>k;
	for(int i=1;i<=k;++i)
	{
		int d;cin>>d;
		for(int j=1;j<=d;++j)
		{
			reg int t;
			cin>>t;
			vis[t]=true;
		}
	}
	reg int ans=0;
	for(int i=1;i<=n;++i)
		if(!vis[i])
			++ans;
	cout<<ans<<endl;
	return 0;
}




Measured memory_bytes: 3652
#include <bits/stdc++.h>
    using namespace std;
     
    int main(){
    int n, k, counter = 0, dummy;
      cin >> n >> k;
    for (int i = 0; i < n; i++){
    cin >> dummy;
    if (dummy >= k) counter++;
    }
    cout << counter;
    return 0;
    }

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
typedef long long ll;
typedef unsigned long long ull;

int P[8], Q[8], T[8];

int main()
{
	int N, p = 0, q = 0, cnt = 0;

	cin >> N;
	rep(i, N) cin >> P[i];
	rep(i, N) cin >> Q[i];
	rep(i, N) T[i] = i + 1;

	do {
		cnt++;
		bool ok = true;
		rep(i, N) {
			if (T[i] != P[i]) ok = false;
		}
		if (ok) p = cnt;
		ok = true;
		rep(i, N) {
			if (T[i] != Q[i]) ok = false;
		}
		if (ok) q = cnt;
	} while (next_permutation(T, T + N));

	cout << abs(p - q) << endl;

	return 0;
}


Measured memory_bytes: 256
/*  -*- coding: utf-8 -*-
 *
 * c.cc: C - Sqrt Inequality
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

/* typedef */

typedef long long ll;

/* global variables */

/* subroutines */

/* main */

int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);

  // sqrt(a)+sqrt(b)<sqrt(c)
  // -> a+2sqrt(a)sqrt(b)+b<c
  // -> 2sqrt(ab)<(c-a-b)
  // -> 4ab < (c-a-b)^2

  if (c > a + b && (ll)a * b * 4 < (ll)(c - a - b) * (c - a - b))
    puts("Yes");
  else
    puts("No");
  return 0;
}


Measured memory_bytes: 256
/*
                                            lllllll                                                                                     tttt          
                                            l:::::l                                                                                  ttt:::t          
                                            l:::::l                                                                                  t:::::t          
                                            l:::::l                                                                                  t:::::t          
    ssssssssss           ooooooooooo         l::::l         ooooooooooo            cccccccccccccccc       aaaaaaaaaaaaa        ttttttt:::::ttttttt    
  ss::::::::::s        oo:::::::::::oo       l::::l       oo:::::::::::oo        cc:::::::::::::::c       a::::::::::::a       t:::::::::::::::::t    
ss:::::::::::::s      o:::::::::::::::o      l::::l      o:::::::::::::::o      c:::::::::::::::::c       aaaaaaaaa:::::a      t:::::::::::::::::t    
s::::::ssss:::::s     o:::::ooooo:::::o      l::::l      o:::::ooooo:::::o     c:::::::cccccc:::::c                a::::a      tttttt:::::::tttttt    
 s:::::s  ssssss      o::::o     o::::o      l::::l      o::::o     o::::o     c::::::c     ccccccc         aaaaaaa:::::a            t:::::t          
   s::::::s           o::::o     o::::o      l::::l      o::::o     o::::o     c:::::c                    aa::::::::::::a            t:::::t          
      s::::::s        o::::o     o::::o      l::::l      o::::o     o::::o     c:::::c                   a::::aaaa::::::a            t:::::t          
ssssss   s:::::s      o::::o     o::::o      l::::l      o::::o     o::::o     c::::::c     ccccccc     a::::a    a:::::a            t:::::t    tttttt
s:::::ssss::::::s     o:::::ooooo:::::o     l::::::l     o:::::ooooo:::::o     c:::::::cccccc:::::c     a::::a    a:::::a            t::::::tttt:::::t
s::::::::::::::s      o:::::::::::::::o     l::::::l     o:::::::::::::::o      c:::::::::::::::::c     a:::::aaaa::::::a            tt::::::::::::::t
 s:::::::::::ss        oo:::::::::::oo      l::::::l      oo:::::::::::oo        cc:::::::::::::::c      a::::::::::aa:::a             tt:::::::::::tt
  sssssssssss            ooooooooooo        llllllll        ooooooooooo            cccccccccccccccc       aaaaaaaaaa  aaaa               ttttttttttt  
*/
#include <bits/stdc++.h>
using namespace std;
#define YukinonMyWife   ios::sync_with_stdio(0); cin.tie(NULL);
#define mem(i,j)        memset(i,j,sizeof (i))
#define size(v)         (long long)(v).size()
typedef int64_t   ll;
typedef uint64_t ull;
const double EPS  =       1e-8;
const  int   INF  =     0x3F3F3F3F;
const   ll   LINF = 4611686018427387903;
const  int   MOD  =       1e9+7;



void solve() {
  
}


signed main() {
  YukinonMyWife
  ull a;
  double b;
  cin >> a >> b;
  int B = (b + EPS) * 100;
  a *= B;
  cout << a / 100 << endl;
  
  return 0;
}


Measured memory_bytes: 3728