akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {

            //入力読取。
            string strNAndM = Console.ReadLine();
            string[] strNAndMArray = strNAndM.Split(' ');
            int intN = int.Parse(strNAndMArray[0]);
            int intM = int.Parse(strNAndMArray[1]);
            int[,] intVectorAArray = new int[intN, intM];
            for (int readIndex = 0; readIndex < intN; readIndex++)
            {
                string strVectorA = Console.ReadLine();
                string[] strVectorAArray = strVectorA.Split(' ');
                for (int castIndex = 0; castIndex < intM; castIndex++)
                {
                    intVectorAArray[readIndex, castIndex] = int.Parse(strVectorAArray[castIndex]);
                }
            }
            int[] intVectorBArray = new int[intM];
            for (int readIndex = 0; readIndex < intM; readIndex++)
            {
                string strVectorB = Console.ReadLine();
                intVectorBArray[readIndex] = int.Parse(strVectorB);
            }

            //処理。
            int[] intVectorC = new int[intN];
            for (int nIndex = 0; nIndex < intN; nIndex++)
            {
                int intSum = 0;
                for (int mIndex = 0; mIndex < intM; mIndex++)
                {
                    intSum += intVectorAArray[nIndex, mIndex] * intVectorBArray[mIndex];
                }
                intVectorC[nIndex] = intSum;
            }

            //出力
            foreach (int answer in intVectorC)
            {
                Console.WriteLine(answer);
            }
            
            Console.ReadKey();
        }
    }
}



Measured memory_bytes: 15964
import java.io.*;

class Main {
	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
		
		String str = br.readLine();
		int num = Integer.parseInt(str);
		
		System.out.println(num*num*num);
	}
}

Measured memory_bytes: 24192
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(),b=sc.nextInt();
		if(a>b*2){
			System.out.println(a-b*2);
		}
		else
			System.out.println(0);
	}

}

Measured memory_bytes: 21844
let n, x = Scanf.scanf " %d %d" @@ fun a b -> a, b
let a_s = Array.init n @@ fun _ -> Scanf.scanf " %d" @@ (+) 0
let _ =
  Array.sort (-) a_s;
  let c, r = Array.fold_left (fun (c, r) a -> (if a > r then c else c + 1), r - a) (0, x) a_s in
  Printf.printf "%d\n" @@ if r > 0 then n - 1 else c

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define yn(x, ok, ng) cout << ((x)?(ok):(ng)) << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int const INF = 1001001001;

template <typename T_char>
T_char ToUpper (T_char cX) { return toupper(cX); }

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

vector<string> s(3);
rep(i,3) {
    cin >> s[i];
    transform(s[i].begin(), s[i].end(), s[i].begin(), ToUpper<char>);
}

rep(i,3) {
    cout << s[i][0];
}
cout << "\n";
return 0;
}

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

int main(){
    string S, T;
    cin>>S>>T;
    int tmp = 0;
    for(int i = 0; i<S.size(); i++){
        if(S[i] != T[i]) tmp++;
    }
    cout<<tmp<<endl;
    return 0;
}

Measured memory_bytes: 3896
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
    int n; cin >> n;
    int taro_score = 0, hana_score = 0;
    for (int i=0; i<n; ++i) {
        string taro, hana;
        cin >> taro >> hana;
        if (taro > hana) {
            taro_score += 3;
        } else if (taro < hana) {
            hana_score += 3;
        } else {
            taro_score ++;
            hana_score ++;
        }
    }
    cout << taro_score << " " << hana_score << "\n";
    return 0;
}

Measured memory_bytes: 1212
import java.util.*;
public class Main {
	public static void main(String[] args) {
		B();
	}
	
	public static void A() {
		Scanner sc = new Scanner(System.in);
		String s1 = sc.next();
		String s2 = sc.next();
		for(int i=0;i<3;i++) {
			if(s1.charAt(i)!=s2.charAt(2-i)) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
	
	// 1から順に２乗を計算して、Nを超えるかどうか確認する。 O(root(N))
	//２分探索するなら、O(logN)
	// 二分探索で、Nの２乗を超えない最小の平方数を発見
	public static long binsearchN2(long left, long right, int N) {
		if(left >= right) return (long) Math.pow(right, 2);
		long mid = (left+right)/2;
		if(Math.pow(mid, 2) > N ) return binsearchN2(left, mid-1, N);
		else {
			//無限ループを防ぐ　再起する時は必ず、探索範囲が１以上小さくなる
			if(Math.pow(mid+1, 2) > N) return (long) Math.pow(mid, 2) ;
			else return binsearchN2(mid+1,right, N);
		}
	}
	
	public static void B() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		System.out.println(binsearchN2(0,N,N));
	}
}


Measured memory_bytes: 23124
#include <stdio.h>

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

    if (a > b) {
        puts("a > b");
    } else if (a < b) {
        puts("a < b");
    } else {
        puts("a == b");
    }
    return 0;
}

Measured memory_bytes: 580
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define R cin>>
#define C cout<<
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  int a,b,c;
  R a;
  R b;
  R c;
  cout << (a + b + c >= 22 ? "bust" : "win") << endl;
}

Measured memory_bytes: 256
x = int(input())

if x>= 105*20:
  print(1)
  exit()
  
  
dp = [0 for i in range(x+1)]
dp[0]= 1

for i in range(x):
  if dp[i]== 1:
    for  j in range(100,105+1):
      if i+j<= x:
        dp[i+j] = 1
print(dp[x])

Measured memory_bytes: 3060
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:https://beta.atcoder.jp/contests/abc101/tasks/abc101_b>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    string N; cin >> N;
    cout << (strtoll(N.c_str(),NULL,10)%(accumulate(N.begin(),N.end(),0)-N.length()*'0')==0?"Yes":"No") << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			long a = sc.nextLong();
			long b = sc.nextLong();
			long gcd = gcd(a, b);
			long bk = (long) Math.sqrt(gcd);
			int ans = 0;
			if (gcd % 2 == 0) {
				gcd = divide(gcd, 2);
				ans++;
			}
			for (long i = 3; i <= gcd; i = i + 2) {
				if (i > bk) {
					break;
				}
				if (gcd % i == 0) {
					gcd = divide(gcd, i);
					ans++;
				}
			}
			ans++;
			if (gcd != 1) {
				ans++;
			}
			System.out.println(ans);
		}
	}

	static long gcd(long a, long b) {
		long temp;
		while ((temp = a % b) != 0) {
			a = b;
			b = temp;
		}
		return b;
	}

	static long divide(long a, long b) {
		while ((a % b) == 0) {
			a = a / b;
		}
		return a;
	}
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
typedef long long ll;
#define N 200005

int n, m;
int tot = 0, fir[N], nxt[N << 1], to[N << 1];
ll fac[N], ifac[N], inv[N];

inline void addEdge(int u, int v) {
    nxt[++tot] = fir[u], fir[u] = tot, to[tot] = v;
}

ll ans = 1;

void dfs(int u, int p, int r) {
    int cnt = 0;
    for (int i = fir[u], v; i; i = nxt[i]) {
        v = to[i]; if (v == p) continue;
        ++cnt; dfs(v, u, r);
    }
    if (u == r) ans = 1ll * ans * fac[m - 1] % Mod * ifac[m - cnt - 1] % Mod;
    else ans = 1ll * ans * fac[m - 2] % Mod * ifac[m - cnt - 2] % Mod;
}

int main() {
#ifdef whyqx
    freopen("work.in", "r", stdin);
    freopen("work.out", "w", stdout);
#endif
    cin >> n >> m;
    fac[0] = 1;
    for (int i = 1; i <= m; ++i)
        fac[i] = 1ll * fac[i - 1] * i % Mod;
    inv[1] = 1;
    for (int i = 2; i <= m; ++i)
        inv[i] = 1ll * inv[Mod % i] * (Mod - Mod / i) % Mod;
    ifac[0] = 1;
    for (int i = 1; i <= m; ++i)
        ifac[i] = 1ll * ifac[i - 1] * inv[i] % Mod;
    for (int i = 1, u, v; i < n; ++i)
        scanf("%d%d", &u, &v),
        addEdge(u, v), addEdge(v, u);
    dfs(1, 0, 1);
    ans = 1ll * ans * m % Mod;
    cout << ans << endl;
    return 0;
}


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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm(a, b) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

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

vector<int> Div(int n) {
    vector<int> ret;
    for(int i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);

            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int n, m;
    cin >> n >> m;
    vector<P> v(m);
    for(int i = 0; i < m; ++i) {
        cin >> v[i].S >> v[i].F;

    }
    sort(all(v));

    int mn = v[0].F;
    int cnt = 1;
    for(int i = 1; i < m; ++i) {
        if(mn <= v[i].S) {
            ++cnt;
            mn = max(mn, v[i].F);

        }

    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 1024
N,K = map(int,input().split())
H = list(map(int,input().split()))
dp = [10**18]*N
dp[0] = 0
for i in range(1,N):
    for j in range(max(0,i-K),i):
        dp[i] = min(dp[i], dp[j] + abs(H[i]-H[j]))
print(dp[-1])

Measured memory_bytes: 52448
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }
//ミョ(-ω- ?)
int main() {
    ll a,b;
    cin >> a >> b;
    cout << (a+b)/2 << endl;
    return 0;
}


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

using namespace std;
using vi=vector<int>;
using ull=unsigned long long;

typedef long long ll;

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

	int r, D, x2; cin >> r >> D >> x2;
	ull ans = 0;

	vector<ull> aux;
	ull a = (r*x2) - D;
	aux.push_back(a);

	for (int i = 0; i < 9; i++){
		ull a = (r*aux[i]) - D;
		aux.push_back(a);
	}


	for (auto &i: aux){
		cout << i << "\n";
	}

    
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
using namespace std;

#define MAX_H 100
#define MAX_W 100

#define INF (1<<28)

bool isdigit(string s) {
    for (int i = 0; i < s.size(); i++) 
        if (!isdigit(s[i]))
            return false;
    return true;
}

int to_i(string s) {
    istringstream is(s);
    int n; is >> n;
    return n;
}

int w, h;
string F[MAX_H][MAX_W];
int sy, sx;
int gy, gx;

struct P {
    int y, x;
    int t;
    P(int y=0, int x=0) : y(y), x(x) { t = INF; }
};

int dist(const P &a, const P &b) {
    return abs(a.x - b.x) + abs(a.y - b.y);
}

vector<P> graph[50*50+1];
int main() {
    while (cin >> w >> h, w || h) {
        for (int i = 0; i <= 50*50; i++) graph[i].clear();
        for (int i = 0; i < h; i++) 
            for (int j = 0; j < w; j++) 
                cin >> F[i][j];
        int n = 0;
        for (int i = 0; i < h; i++)
            for (int j = 0; j < w; j++) {
                if (isdigit(F[i][j])) {
                    graph[to_i(F[i][j])].push_back(P(i, j));
                    n = max(n, to_i(F[i][j]));
                }
                if (F[i][j] == "S") sy = i, sx = j;
                if (F[i][j] == "G") gy = i, gx = j;
            }
        graph[0].push_back(P(sy, sx)); graph[0][0].t = 0;
        graph[n+1].push_back(P(gy, gx));
        for (int i = 1; i <= n+1; i++) {
            for (int j = 0; j < graph[i].size(); j++) {
                for (int k = 0; k < graph[i-1].size(); k++) {
                    graph[i][j].t = min(graph[i][j].t, graph[i-1][k].t + dist(graph[i-1][k], graph[i][j]));
                }
            }
        }
        //for (int i = 1; i <= n+1; i++) {
        //    cout << "i = " << i << endl;
        //    for (int j = 0; j < graph[i].size(); j++) {
        //        cout << graph[i][j].t << ' ';
        //    }
        //    cout << endl;
        //}
        cout << graph[n+1][0].t << endl;
    }
    return 0;
}

Measured memory_bytes: 1728
S=input()
def dfs(s,i):
  if i==len(S)-1:
    return sum(map(int,s.split("+")))
  return dfs(f"{s}{S[i+1]}",i+1)+dfs(f"{s}+{S[i+1]}",i+1)
print(dfs(S[0],0))

Measured memory_bytes: 9052
# 1行目の入力を数値として扱う
N = int(input())
# 2行目の入力を空白で分割された文字列として扱う
S, T = map(str, input().split())

# 答えの準備
res = ""

# N回繰り返し
for i in range(0, N):
    res += S[i] + T[i]

# 答えの出力
print(res)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define PI acos(-1)
#define sz 100010
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;

int main()
{
    RUN_FAST; cin.tie(nullptr);
    string s, ss="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    cin >> s;
    s=ss.substr(0, s.size());
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3592
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef set<int> si;
typedef string str;
typedef map<int,ll> mil;
const int INF=1e+9;
const int NMAX=110000;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int N;
int X[100010],Y[100010];
mil mx,my;
class uft{
public:
  int par[NMAX*2];//親
  int rank[NMAX*2];//木の深さ
  int size[NMAX*2];//木の大きさ
  uft(int n);//コンストラクタ
  int find(int x);
  void unite(int x,int y);
  bool same(int x,int y);
  int usize(int x);
};
uft::uft(int n){//コンストラクタ uft uf(N)でサイズNのunionfindtreeを宣言 
  for(int i=0;i<n;i++){
    par[i]=i;
    rank[i]=0;
    size[i]=1;
  }
}
int uft::find(int x){//xの根を返す
  if(par[x]==x) return x;//根の親は自分自身
  else return par[x]=find(par[x]);//再起で親を辿る
}
void uft::unite(int x,int y){//x,yを併合
  x=find(x);
  y=find(y);
  if(x==y) return ;//根が同じなら併合する必要なし

  if(rank[x]<rank[y]){//木の深い方に浅い方をつける
    par[x]=y;
    size[y]+=size[x];
  }
  else{
    par[y]=x;
    size[x]+=size[y];
    if(rank[x]==rank[y]) rank[x]++;//同じ深さなら深さを増やす
  }
}
bool uft::same(int x,int y){//x,yが同じグループにいるかどうかを返す
  return find(x)==find(y);//根が同じかどうかを判断する
}
int uft::usize(int x){//xの属する木のサイズを返す
  return size[find(x)];
}


int main(){
  cin>>N;
  rep(i,N) cin>>X[i]>>Y[i];
  uft uf(NMAX*2);
  rep(i,N) uf.unite(X[i],Y[i]+NMAX);
  rep(i,NMAX) mx[uf.find(i)]++;
  rep(i,NMAX) my[uf.find(i+NMAX)]++;  
  ll res=0;
  rep(i,NMAX*2) res+=mx[i]*my[i];
  prin(res-N);
  return 0;
}


Measured memory_bytes: 31104
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

int main() {
    string s;
    cin >> s;
    int n = s.size();

    vector<ll> dp0(n+1);  /* dp0[i+1] : aおよびbの上からi桁目(iは0-index)までを確定させ、
                                         その時点ではまだa+bがs未満になるかわかっていない
                                         (a, b)の組の個数 */
    
    vector<ll> dp1(n+1);  /* dp1[i+1] : aおよびbの上からi桁目(iは0-index)までを確定させ、
                                         その時点で既にa+bがs未満であることがわかっている
                                         (a, b)の組の個数 */

    dp0[0] = 1;  // 1桁も確定していない時点ではs未満になるかわからない
    rep(i, n) {
        // (a_i, b_i) = (0, 0) の場合
        if(s[i] == '0') {
            dp0[i+1] = dp0[i];
            dp1[i+1] = dp1[i];
        }
        else if(s[i] == '1') {
            dp1[i+1] = dp0[i] + dp1[i];
            dp1[i+1] %= mod;
        } 
        // (a_i, b_i) = (0, 1), (1, 0) の場合
        if(s[i] == '0') {
            dp1[i+1] += 2*dp1[i];
            dp1[i+1] %= mod;
        }
        else if(s[i] == '1') {
            dp0[i+1] += 2*dp0[i];
            dp1[i+1] += 2*dp1[i];
            dp0[i+1] %= mod;
            dp1[i+1] %= mod;
        }
    }

    ll ans = (dp0[n] + dp1[n])%mod;

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

Measured memory_bytes: 2048
import java.io.*;
public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		String line = reader.readLine();
		String[] sarray = line.split(" ", -1);
		int n = Integer.parseInt(sarray[0]);
		int m = Integer.parseInt(sarray[1]);
		int l = Integer.parseInt(sarray[2]);
		int matrixA[][] = new int[n][m];
		int matrixB[][] = new int[m][l];
		long matrixC[][] = new long[n][l];
		for(int i = 0; i < n; i++){//??????A???????????????
			String str = reader.readLine();
			String[] mat = str.split(" ", -1);
			for(int j = 0; j < m; j++){
				matrixA[i][j] = Integer.parseInt(mat[j]);
			}
		}
		for(int i = 0; i < m; i++){//??????B???????????????
			String str = reader.readLine();
			String[] mat = str.split(" ", -1);
			for(int j = 0; j < l; j++){
				matrixB[i][j] = Integer.parseInt(mat[j]);
			}
		}
		for(int i = 0; i < n; i++){//??????C????????????
			for(int j = 0; j < l; j++){
				matrixC[i][j] = 0;
			}
		}
		for(int i = 0; i < n; i++){//??????A,??????B??????
			for(int j = 0; j < l; j++){
				for(int k = 0; k < m; k++){
					matrixC[i][j] += matrixA[i][k]*matrixB[k][j];
				}
				System.out.print(matrixC[i][j]);
				if(j != l - 1){
					System.out.print(" ");
				}else{
					System.out.println();
				}
			}
		}
	}
}

Measured memory_bytes: 37184
#include <bits/stdc++.h>
using namespace std;
int n,l,r,h;
int main()
{
     cin>>n;//输入n
     for(int i=1;i<=n;i++)
     {
        cin>>l>>r;
        h+=(r-l)+1;
     }
     cout<<h<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


def ceil(a, b): return (a + b - 1) // b


inf = float('inf')
mod = 10 ** 9 + 7


def pprint(*A):
    for a in A:     print(*a, sep='\n')


def INT_(n): return int(n) - 1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [I() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    X = LI()
    for i in range(5):
        if X[i] == 0:
            print(i + 1)


if __name__ == '__main__':
    main()

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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int a,b,c,d,e,f;
void solve(){
	cin >> a >> b >> c >> d >> e >> f;
	a*=100; b*=100;
	
	int ans = a, ans2 = 0;
	for(int i = 0; i <= f; i+=a){
		for(int j = i; j <= f; j+=b){
			for(int ii = 0; ii+j <= f; ii+=c){
				for(int jj = ii; jj+j <= f; jj+=d){
					if(jj*100 > j*e) break;
					if(ans*jj > (jj+j)*ans2){
						ans = jj+j;
						ans2 = jj;
					}
				}
			}
		}
	}
	cout << ans << " " << ans2 << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 256
n = int(input())
score_list = []

for i in range(n):
    score_list.append(list(input().split() +[str(i+1)]))
    score_list[i][1] = 100 - int(score_list[i][1])
score_list.sort()
for i in range(n):
    print(score_list[i][2])


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

class Main{
    public static void main(String[] args)throws IOException{

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        
        while (true) {
            int i, sum = 0;
            if (buf.charAt(0) - '0' == 0) break;
            for (i = 0;i < buf.length();i++) {
                sum += buf.charAt(i)-'0';
            }
            System.out.println(sum);
            buf = br.readLine();
        }
    }
}

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

#define int long long
#define inf 1000000007LL

#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1LL; i >= 0; i--)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rep1(i, n) for(int i = 1LL; i <= (n); i++)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)
/*
class Dinic {
public:
  vector<vector<pair<int, int>>> v;
  vector<int> e;

  vector<int> k;
  vector<int> j;

  void init(int n) {
    v = vector<vector<pair<int, int>>>(n);
    e = vector<int>();
    k = vector<int>(n);
    j = vector<int>(n);
  }
  void add_edge(int a, int b, int atob, int btoa = 0) {
    v[a].push_back(make_pair(b, e.size()));
    e.push_back(atob);
    v[b].push_back(make_pair(a, e.size()));
    e.push_back(btoa);
  }
  void dyk(int s) {
    for(auto& i : k) {
      i = inf;
    }
    queue<pair<int, int>> pq;
    pq.push(make_pair(0, s));
    while(!pq.empty()) {
      int w = pq.front().first;
      int b = pq.front().second;
      pq.pop();
      if(k[b] > w) {
        k[b] = w;
        for(auto i : v[b]) {
          if(e[i.second] > 0) {
            pq.push(make_pair(w + 1LL, i.first));
          }
        }
      }
    }
  }
  int dfs(int s, int t, int p, int c) {
    if(p == t) {
      return c;
    }
    int all = 0;
    while(c > all && j[p] < v[p].size()) {
      if(k[v[p][j[p]].first] == k[p] + 1LL) {
        int r = dfs(s, t, v[p][j[p]].first, min(c - all, e[v[p][j[p]].second]));
        e[v[p][j[p]].second] -= r;
        e[v[p][j[p]].second ^ 1LL] += r;
        if(r < c - all) {
          j[p]++;
        }
        all += r;
      }
      else {
        j[p]++;
      }
    }
    return all;
  }
  int solve(int s, int t) {
    int all = 0;
    while(1LL) {
      dyk(s);
      for(auto& i : j) {
        i = 0;
      }
      int r = dfs(s, t, s, inf);
      if(r == 0) {
        return all;
      }
      all += r;
    }
  }
};
*/

int c[100];

signed main() {
  rep(i, 100) {
    c[i] = 0;
  }
  int n;
  cin >> n;
  int all = 0;
  rep(i, n) {
    int w;
    cin >> w;
    if(w >= 3200) {
      all++;
    }
    else {
      c[w / 400] = 1;
    }
  }
  int ans = 0;
  rep(i, 100) {
    ans += c[i];
  }
  cout << max(1LL, ans) << " " << ans + all << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

using namespace std;

using ll = long long int;
#define int ll

const int MOD = 1e9 + 7;
const int INF = 1e15 + 373;

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

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> init_vector2(size_t n0, size_t n1, T e = T()) {
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> init_vector3(size_t n0, size_t n1, size_t n2, T e = T()) {
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "[";
    for (T e : v) {
        os << e << ", ";
    }
    os << "]";
    return os;
}

int solve(const vector2<int>& g, int v) {
    const int m = g[v].size();
    if (m == 0) {
        return 0;
    }

    vector<int> h(m);
    for (int i = 0; i < m; i++) {
        h[i] = solve(g, g[v][i]);
    }
    sort(h.begin(), h.end());

    int ans = 0;
    for (int i = 0; i < m; i++) {
        ans = max(ans, h[i] + m - i);
    }
    return ans;
}

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

    vector2<int> g = init_vector2<int>(n, 0);
    for (int i = 1; i < n; i++) {
        int a;
        cin >> a;
        a--;
        g[a].push_back(i);
    }

    cout << solve(g, 0) << endl;

    return 0;
}


Measured memory_bytes: 21376
#ifdef _DEBUG
#include ".vscode/debug_print.hpp"
#else
#define debug(...)
#endif
#include <bits/stdc++.h>

using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1050000000;
constexpr long long INF64 = 4000000000000000000;
constexpr int MOD7        = 1000000007;
constexpr int MOD53       = 998244353;
constexpr long double PI  = 3.14159265358979323846;
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;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}

void vprint() { std::cout << '\n'; }
template <class H, class... T> void vprint(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << '\n';
    vprint(std::forward<T>(args)...);
}
template <class T> void vprint(std::vector<T> &v) {
    for (auto &&i : v) {
        std::cout << i << '\n';
    }
}

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

    int N;
    string s;
    scan(N, s);

    ll r = 0, g = 0, b = 0;
    for (size_t i = 0; i < N; i++) {
        if (s[i] == 'R')
            r++;
        if (s[i] == 'G')
            g++;
        if (s[i] == 'B')
            b++;
    }
    ll ans = r * g * b;

    auto is_rgb = [](string a) {
        sort(a.begin(), a.end());
        return "BGR" == a;
    };
    for (size_t i = 0; i < N; i++) {
        for (size_t j = i + 1; j < N; j++) {
            size_t k = 2 * j - i;
            if (j < k && k < N) {
                string x = string{s[i]} + string{s[j]} + string{s[k]};
                if (is_rgb(x))
                    ans--;
            }
        }
    }
    print(ans);

    return 0;
}

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

typedef long long int64;
const int MAX = 2e5 + 5;
int n, p, t[MAX], freq[MAX];
char s[MAX];

int main() {
	scanf("%d%d", &n, &p);
	scanf("%s", s);

	reverse(s, s + n);

	if(10 % p == 0) {
		int64 ans = 0;
		for(int i = 0; i < n; i++)
			if((s[i] - '0') % p == 0)
				ans += n - i;

		printf("%lld\n", ans);
		return 0;
	}

	int pw = 1;
	int64 ans = 0;

	freq[0] = 1;
	for(int i = 0; i < n; i++) {
		int d = s[i] - '0';
		t[i] = (t[i - 1] + (1LL * pw * d) % p) % p;
		pw = 1LL * pw * 10 % p;

		ans += freq[t[i]];
		freq[t[i]]++;
	}

	printf("%lld\n", ans);
	return 0;
}

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

int main()
{
  string s;

  cin >> s;
  int n = s.size();
  if(n < 4 || s[0] != 'A') {
    cout << "WA" << endl;
    return 0;
  }
  int count = 0;
  for(int i=1; i<n; i++) {
    if(isupper(s[i])) {
      if(i==1 || i==n-1 || s[i]!='C') {
        cout << "WA" << endl;
        return 0;
      }
      count++;
    }
  }
  if(count != 1) {
    cout << "WA" << endl;
    return 0;
  }
  cout << "AC" << endl;
  return 0;
}


Measured memory_bytes: 256
require 'prime'
require 'set'
require 'tsort'
include Math
ALP = ('a'..'z').to_a
INF = 0xffffffffffffffff
def max(a,b);              a > b ? a : b                              end
def min(a,b);              a < b ?  a : b                             end
def swap(a,b);             a, b = b, a                                end
def gif;                   gets.to_i                                  end
def gff;                   gets.to_f                                  end
def gsf;                   gets.chomp                                 end
def gi;                    gets.split.map(&:to_i)                     end
def gf;                    gets.split.map(&:to_f)                     end
def gs;                    gets.chomp.split.map(&:to_s)               end
def gc;                    gets.chomp.split('')                       end
def pr(num);               num.prime_division                         end
def pr?(num);              Prime.prime?(num)                          end
def digit(num);            num.to_s.length                            end
def array(s,ini=nil);      Array.new(s){ini}                          end
def darray(s1,s2,ini=nil); Array.new(s1){Array.new(s2){ini}}          end
def rep(num);              num.times{|i|yield(i)}                     end
def repl(st,en,n=1);       st.step(en,n){|i|yield(i)}                 end

n = gif
a = gi
mx = a.max
mn = a.min
ans = []
if mx.abs > mn.abs
  idx = a.index mx
  rep n do |i|
    a[i] += mx
    ans << "#{idx+1} #{i+1}"
  end
  rep n-1 do |i|
    a[i+1] += a[i]
    ans << "#{i+1} #{i+2}"
  end
else
  idx = a.index mn
  rep n do |i|
    a[i] += mn
    ans << "#{idx+1} #{i+1}"
  end
  repl n-2,0,-1 do |i|
    a[i] += a[i+1]
    ans << "#{i+2} #{i+1}"
  end
end

puts ans.size
puts ans


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

int main(){
    int N, K;
    cin >> N >> K;
    long long x[100100];
    for(int i=0; i<N; i++){
        cin >> x[i];
    }
    auto a = lower_bound(x,x+N,0);
    auto c = a-x;
//    cout << c <<endl;
    long long ans=pow(10,10);
    for(int i=0; i<=K; i++){
        if(c-i>=0 && c-i+K-1 <N){
            long long t=x[c-i], s=x[c-i+K-1];
            long long dif;
            if(t*s<=0) dif=s-t+min(s,-t);
            else dif = max(abs(t),abs(s));
            ans = min(ans,dif);
        }
    }
    cout << ans << endl;
}

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

const long long INF = 1LL << 60;

//input
int N;
long long h[100010];

//DP_table
long long dp[100010];

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

	//init
	dp[0] = 0;
	for (int i = 1; i < N; i++) dp[i] = INF;

	//loop
	for (int i = 1; i < N; i++) {
		chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
		if(i>1) chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
	}

	//answer
	cout << dp[N - 1] << endl;

	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b){return (1ll*a*b)/gcd(a, b);}

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n;
    cin>>n;
    for(int i=1;i<=9;++i)
    {
        for(int j=1;j<=9;++j)
        {
            if(i*j==n)
            {
                cout<<"Yes"; return 0;
            }
        }
    }
    cout<<"No";
}


Measured memory_bytes: 256
from itertools import accumulate
N, K = map(int, input().split())
S = [0] + list(accumulate(range(N+2)))
M = 10**9 + 7
ans = 0
for i in range(K, N+2):
    ans += S[N+2] - S[N+2-i] - S[i+1] + 1
    ans %= M
print(ans)

Measured memory_bytes: 78660
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e5+10;
int n,m,t[N];
ll sum[N],pre[N],suf[N],y[N];
long double K(int i,int j){
	return 1.0*(y[i]-y[j])/(i-j);
}
int q[N],tail;
void push(int i){
	for (;tail&&K(q[tail-1],q[tail])<K(q[tail],i);tail--);
	q[++tail]=i;
}
ll cost(int i,int j){
	return y[j]-(ll)i*j;
}
ll query(int i){
	int l=1,r=tail;
	while (l<r){
		int mid=(l+r)>>1;
		if (cost(i,q[mid])>cost(i,q[mid+1])) r=mid;else l=mid+1;
	}
	return cost(i,q[l]);
}
void calc(ll *dp){
	for (int i=1;i<=n+1;i++) sum[i]=sum[i-1]+t[i];
	dp[0]=0;q[tail=1]=0;
	for (int i=1;i<=n+1;i++){
		dp[i]=query(i)-sum[i-1]+(ll)i*(i-1)/2;
		y[i]=dp[i]+sum[i]+(ll)i*(i+1)/2;
		push(i);
	}
}
ll dp[N];int from[N];
//枚举右端点，查询左端点 
void solve(int step){
	if (step*2>n){
		int p=0;tail=0;
		dp[step]=-1e16;
		while (p<step) push(p++);
		for (int i=step+1;i<=n+1;i++){
			ll v=query(i)+suf[i]-sum[i-1]+(ll)i*(i-1)/2;
			if (v>dp[step]) dp[step]=v,from[step]=i;
		}
		return;
	}
	solve(step*2);
	int p=0;tail=0;
	for (int i=step;i<=n;i+=step*2){
		dp[i]=-1e16;
		int l=max(from[i-step],i+1),r=i+step>n?n+1:from[i+step];
		while (p<i) push(p++);
		for (int j=l;j<=r;j++){
			ll v=query(j)+suf[j]-sum[j-1]+(ll)j*(j-1)/2;
			if (v>dp[i]) dp[i]=v,from[i]=j;
		}
	}
}
int read(){
	int x=0;char ch;
	do ch=getchar();while (!isdigit(ch));
	while (isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x;
}
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;i++) t[i]=read();
	calc(pre);
	reverse(t+1,t+n+1);
	calc(suf);
	reverse(t+1,t+n+1);
	reverse(suf,suf+n+2);
	for (int i=1;i<=n+1;i++) sum[i]=sum[i-1]+t[i];
	for (int i=0;i<=n+1;i++) y[i]=pre[i]+sum[i]+(ll)i*(i+1)/2;
	solve(1);
	scanf("%d",&m);
	for (int i=1;i<=m;i++){
		int p=read(),x=read();
		printf("%lld\n",max(pre[p]+suf[p],dp[p]+t[p]-x));
	}
	return 0;
}

Measured memory_bytes: 17792
import java.util.*;

/**
 * A
 */
public class Main {
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int flag = 0, count = 0, left, right;

        int n = sc.nextInt();
        int[] S = new int[n];

        for(int i=0; i<n; i++) {
            S[i] = sc.nextInt();
        }

        int q = sc.nextInt();
        int[] T = new int[q];

        for (int i = 0; i<q; i++) {
            T[i] = sc.nextInt();
        }

        sc.close();

        for(int i=0; i<q; i++) {

            int key = T[i];
            flag = 0;
            left = 0;
            right = S.length;

            while(left<right) {

                int mid = (left+right)/2;

                if(key == S[mid]) {
                    flag++;
                    break;
                }

                if(key > S[mid]) {
                    left = mid+1;
                } else if(key < S[mid]) {
                    right = mid;
                }

            }

            if(flag >= 1) {
                count++;
            }

        }

        System.out.println(count);

    }
}


Measured memory_bytes: 80528
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	sll(n); sll(m);
	LL left = 0, right = LONG_MAX;
	rep(i, 0, m) {
		left = max(left, scanLong());
		right = min(right, scanLong());
	}
	if(left <= right)	pll(right-left+1), nl;
	else	puts("0");
}


Measured memory_bytes: 256
N, M = map(int, input().split())
a, b, c = [None] * M, [None] * M, [None] * M
INF = 1e14
d = [-INF] * N
d[0] = 0
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -= 1
    b[i] -= 1

for i in range(N):
    for j in range(M):
        if d[a[j]] + c[j] > d[b[j]]:
            d[b[j]] = d[a[j]] + c[j]
ans = d[N-1]
for i in range(N):
    for j in range(M):
        if d[a[j]] + c[j] > d[b[j]]:
            d[b[j]] = d[a[j]] + c[j]
if ans != d[N-1]:
    print('inf')
else:
    print(ans)


Measured memory_bytes: 47320
from collections import deque


def dfs(field, s):
    MOVE = [(0, 1), (1, 0), (0, -1), (-1, 0)]
    q = deque([(0, s)])
    dist = [[-1] * w for _ in range(h)]

    d, i, j = -1, -1, -1
    while q:
        d, (i, j) = q.popleft()
        if dist[i][j] != -1:
            continue
        dist[i][j] = d
        for di, dj in MOVE:
            ni, nj = i + di, j + dj
            if not 0 <= ni < h or not 0 <= nj < w:
                continue
            if field[ni][nj] == '#':
                continue
            if dist[ni][nj] != -1:  #既に訪問済みの場合はスルー
                continue
            q.append((d + 1, (ni, nj)))
    return d, i, j


h, w = map(int, input().split())
field = [input() for _ in range(h)]
ans = 0
for i in range(h):
    for j in range(w):
        if field[i][j] == '.':
            d, i, j = dfs(field, (i, j))
            ans = max(ans, d)
print(ans)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define M 1000000007
#define all(a) (a).begin(),(a).end()
#define rep(i,n) reps(i,0,n)
#define reps(i,m,n) for(int i=(m);i<(n);i++)
int main(){
  char n;cin>>n;cout<<(char)(n+1);
}

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

int main(){
  ll N,M;
  ll mod = 1e9+7;
  cin >> N >> M;
  vector<ll> hole(N,0);
  for(ll i=0;i<M;++i){
    ll a;
    cin >> a;
    hole[a]=1;
  }
  ll dp[N+10];
  fill(dp,dp+N+10,0);
  dp[0]=1;
  dp[1]=(hole[0]==1) ? 0 : 1;
  for(ll i=2;i<N+5;++i){
    if(!hole[i-1]) dp[i] += dp[i-1];
    if(!hole[i-2]) dp[i] += dp[i-2];
    dp[i] %= mod;
  }
  cout << dp[N] << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	cin>>n;
	int arr[n];
	int mark[1000001]={0};
	for(int i=0;i<n;i++){
		cin>>arr[i];
		mark[arr[i]]+=1;
	}
	int ans=0;
	int fake[1000001]={0};
	for(int i=1;i<1000001;i++){
		if(mark[i]!=0){
			if(mark[i]>1){
				fake[i]=1;
			}
			int j=i*2;
			int count=3;
			while(j<1000001){
				if(mark[j]!=0)
				{
					fake[j]=1;
				}
				j=i*count;
				count++;
			}
		}
	}
	for(int i=1;i<1000001;i++){
		if(mark[i]!=0&&fake[i]==0)
		ans++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 12144
/*******************************************************************
 * 		Author : yash1402_										   *
 ******************************************************************/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;

void solve() {
	ll d,t,s;
	cin >> d >> t >> s;
	if(t*s >= d) cout << "Yes\n";
	else cout << "No\n";
}

int main() {
	ll T=1;
	//cin >> T;
	while(T--) {
		solve();
	}
}



Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	string s;
	cin >> s;
	bool ac = true;
	if(s[0] != 'A'){
		ac = false;
	}
	int c = 0;
	for(int i=2; i<(int)s.size()-1; i++){
		if(s[i] == 'C'){
			c++;
		}
	}
	if(c != 1){
		ac = false;
	}
	int capital = 0;
	for(char c: s){
		if('A' <= c and c <= 'Z'){
			capital++;
		}
	}
	if(capital != 2){
		ac = false;
	}

	if(ac){
		cout << "AC" << endl;
	}else{
		cout << "WA" << endl;
	}
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
   long long int a[10000],min=1000000,max=-1000000,sum=0;
   int n,i;
   scanf("%d",&n);
   for(i=0;i<n;i++){
      scanf("%lld",&a[i]);
      if(a[i]>=max){
         max=a[i];
      }
      if(a[i]<=min){
         min=a[i];
      }
      sum+=a[i];
   }
   printf("%lld %lld %lld\n",min,max,sum);
   return 0;
}

Measured memory_bytes: 676
//Be Name Khoda
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma optimize O3
using namespace __gnu_pbds;
using namespace std;
template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T> using ordered_multiset =  tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long int LL;
typedef LL ll;
typedef long double ld;
typedef string str;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef stringstream strs;
 
#define X first
#define Y second
#define PB push_back
#define For(i,a,b) for (int i=a;i<b;i++)
#define Ford(i,a,b) for (int i=a;i>=b;i--)
#define smax(a,b) a=max(a,b)
#define smin(a,b) a=min(a,b)
#define SZ(a) ((ll)a.size())
#define ER(a) cout << #a << ' ' << a << endl
#define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a))
#define RET(x) { cout << x; exit(0); } 
#define RETD(x) { cout << fixed << setprecision(15) << x; exit(0); }
const ll M=2e5+5,LG=32,SM=600+5,inf=1e18+5;
ll mod=1e9+7;

ll n;
vll g[M];

str z[2]={"First","Second"};

ll dfs(ll x,ll p)
{
    if (SZ(g[x])==1) return 1;
    ll f=0;
    for (ll y:g[x])
    {
        if (y==p) continue;
        f+=dfs(y,x);
    }
    if (f>1) RET(z[0]);
    if (f==1) return 0;
    return 1;
}

int main()
{
    cin >> n;
    if (n==2) RET(z[1]);
    if (n==1) RET(z[0]);
    ll x;
    For(i,1,n)
    {
        ll u,v;
        cin >> u >> v;
        u--;v--;
        g[u].PB(v);g[v].PB(u);
    }
    For(i,0,n) if (SZ(g[i])>1) x=i; 
    RET(z[!dfs(x,x)]);
}    


Measured memory_bytes: 8704
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
    // スペース区切りの整数の入力
    int h,n;
    cin >> h >> n;
  
    int aSum = 0;
    for (int i = 0; i < n; ++i) {
       int tmpA;
       cin >> tmpA;
       aSum += tmpA;
    }

    // 出力
    if ( h <= aSum ) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl; 
    }

    return 0;
}

Measured memory_bytes: 256