akhauriyash/Code-Regression huggingface dataset:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
p = list(map(int, readline().split()))
cnt = 0
min_p = float('inf')
for i in range(n):
    min_p = min(min_p, p[i])
    if min_p == p[i]:
        cnt += 1
print(cnt)


Measured memory_bytes: 20348
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = LONG_LONG_MAX / 2;
const ll mod = 1000000000 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
  int n;
  cin >> n;
  vector<int> vodd(100001, 0), veven(100001, 0);
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    if (i % 2 == 0)
      veven[v]++;
    else
      vodd[v]++;
  }

  auto even_max_pos = 1;
  auto even_2nd_pos = 0;
  auto odd_max_pos = 1;
  auto odd_2nd_pos = 0;

  auto fn = [](int& imax, int& i2ndmax, const vector<int>& v) {
    for (size_t i = 2; i < v.size(); i++) {
      if (v[imax] <= v[i]) {
        i2ndmax = imax;
        imax = i;
      } else if (v[i2ndmax] <= v[i]) {
        i2ndmax = i;
      }
    }
  };

  fn(even_max_pos, even_2nd_pos, veven);
  fn(odd_max_pos, odd_2nd_pos, vodd);

  if (even_max_pos != odd_max_pos) {
    cout << n - veven[even_max_pos] - vodd[odd_max_pos] << endl;
  } else {
    cout << min(n - veven[even_max_pos] - vodd[odd_2nd_pos],
                n - veven[even_2nd_pos] - vodd[odd_max_pos])
         << endl;
  }
}


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

int main() {
  int n;
  cin >> n;
  long long sum = 0;
  for(int i = 1; i <= n; i++) {
    if(i % 3 != 0 && i % 5 != 0) {
      sum += i;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3636
#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("nuroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORR(x,arr) for(auto& x:arr)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define FI first 
#define SE second
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------


struct mint {
	ll x;
	mint(ll x=0):x(x%mod){}

	bool operator==(const mint a)const{return x==a.x;}
	bool operator!=(const mint a)const{return x!=a.x;}
	bool operator>=(const mint a){return (x >= a.x)? 1: 0;}
	bool operator<(const mint a){return !(*this>=a);}
	bool operator>(const mint a){return (x > a.x)? 1:0;}
	bool operator<=(const mint a){return !(*this>a);}
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
			return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod-a.x) >= mod) x -= mod;
			return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res+=a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res-=a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res*=a;
	}
	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t>>1);
		a *= a;  //2 square
		if (t&1) a *= *this; 
		return a;
	}
	// for prime mod
	mint inv() const {
		return pow(mod-2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res/=a;
	}
};

template <class T>
T gcd(T x, T y){
	T r;
	if(x < y) swap(x,y);
	while(y > 0){
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

int n;
map<PLL, int> mp;
int both0 = 0;

int main(){
    cin >> n;
	
    FOR(i,1,n) {
        ll a,b; cin >> a >> b;
		if (!a and !b) {
			both0++; continue;
		}
		if (!a) {
			mp[{0, -1}]++;
			continue;
		}
		if (!b) {
			mp[{1,0}]++;
			continue;
		}

		ll gd = gcd(abs(a),abs(b));
		a /= gd; b /= gd;
		if(a < 0) {
			a = -a;
			b = -b;
		}
		mp[{a,b}]++;
    }


	mint ans = mint(1);
	for(auto [k, v]: mp) {
		// cout << k.first << " " << k.second << " " << v << endl;
		// ll ca = abs(k.second);
		// ll cb = k.first*(k.first*k.second<0?1:-1);
		PLL p;
		if(k.second < 0) p = {-k.second, k.first};
		else p = {k.second, -k.first};
		// cout << ca << " " << cb << " " << v << endl;
		// PII p = {ca, cb};
		// if(k == p) ans *= mint(2).pow(v); 
		if(mp.count(p)) {
			if (k.second < 0) continue;
			ans *= mint(2).pow(v) + mint(2).pow(mp[p]) - 1;
		}
		else ans *= mint(2).pow(v);
		// cout << "ans" << ans.x << endl;
	}

	ans += both0;
	ans -= 1;
	cout << ans.x << endl;
	return 0;
}


Measured memory_bytes: 15920
import math
a,b,h,m = list(map(int, input().split()))

k_c = abs((m / 60 * 360) - (h / 12 * 360 + m / 60 * 30))

if k_c > 180:
  k_c = 360 - k_c

print (math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(k_c))))


Measured memory_bytes: 9508
n = int(input())
s = []
for i in range(n):
    s.append(str(input()))
m = int(input())
t = []
for i in range(m):
    t.append(str(input()))

lst = list(set(s+t))
sumlst = [0]

for i in range(len(lst)):
    sumlst.append(s.count(lst[i])-t.count(lst[i]))

print(max(sumlst))

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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};

ll mod = 1e9+7;
vector<ll> ls[100010];
ll parentCnt[100010];
bool visited[100010];
ll n,k,ans=1;

int main()
{
    cin>>n>>k;
    vector<ll> a(n-1),b(n-1);

    for (int i = 0; i < n-1; i++)
    {
        cin>>a[i]>>b[i];
        a[i]--;
        b[i]--;
    }
    m0(parentCnt);
    m0(visited);
    for (int i = 0; i < n-1; i++)
    {
        ls[a[i]].push_back(b[i]);
        ls[b[i]].push_back(a[i]);
    }
    
    queue<pair<ll,ll>> q; //now, parent
    visited[0]=true;
    for (int i = 0; i < ls[0].size(); i++)
    {
        q.push(make_pair(ls[0][i],0));
        visited[ls[0][i]]=true;
    }
    parentCnt[0]=1;
    ans*=k;
    ans%=mod;
    visited[0]=true;
    while (q.size()>0)
    {
        pll p = q.front();
        q.pop();
        ll now = p.first;
        ll parent = p.second;
        ans*=(k-parentCnt[parent]);
        ans%=mod;
        
        //cout<<now<<" "<<ans<<" "<<parentCnt[parent] <<endl;
        parentCnt[parent]++;
        parentCnt[now]+=2;
        
        for (int i = 0; i < ls[now].size(); i++)
        {
            ll next = ls[now][i];
            if(visited[next] == false)
            {
                q.push(make_pair(ls[now][i], now));
                visited[next] = true;
            }
        }
    }
    
    
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 10612
#include<bits/stdc++.h>
int main()
{
    char s[200];
    scanf("%s",s);
    int len=0;
    for(int i=0;s[i]!=0;i++)
    len++;
    int cnt=0;
    for(int i=0,j=len-1;i<=j;i++,j--)
    {
    if(s[i]!=s[j])
    {
    cnt++;
    }
}
    printf("%d",cnt);


    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <functional>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;


int main(void) {
	int N;
	cin >> N;
	int ans = 0;
	if (N % 10 == 7) ans++;
	N = N - (N % 10);
	if (N % 100 == 70) ans++;
	N = N - (N % 100);
	if (N == 700) ans++;

	if (ans > 0) cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

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

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  long double a, b, n;
  cin >> a >> b >> n;
  long double x = min(n, b - 1);
  long double res = floor(a * x / b) - a * floor(x / b);
  cout << (long long) res << '\n';
  return 0;
}

Measured memory_bytes: 3752
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main(){
    ios::sync_with_stdio(false);
    int d,g,ans=INT_MAX;
    cin>>d>>g;
    vector<int>p(d);
    vector<int>c(d);
    for(int i=0;i<d;i++){
        cin>>p[i]>>c[i];
    }
    for(int i=0;i<(1<<d);i++){
        int sum=0,con=0;
        vector<int>check(p);
        for(int j=0;j<d;j++){
            if(i&(1<<j)){
                con+=p[j];
                sum+=(j+1)*100*p[j]+c[j];
                check[j]=0;
            }
        }
        if(sum<g){
            vector<int>copy(p);
            for(int j=d-1;j>=0;j--){
                for(int k=0;k<check[j];k++){
                    sum+=(j+1)*100;
                    con++;
                    if(sum>=g){
                        goto Exit;
                    }
                }
            }
        }
        Exit:;
        if(sum>=g && con<=ans){
            ans=con;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>

#define ll long long
#define Inf 1000000001
using namespace std;


int A[333][333];

ll Solve2(int N) {
    vector<pair<ll,pair<int,int> > > dist_sorted;
    ll ans = 0;
    for(int i=1;i<=N;i++)
        for(int j=i+1;j<=N;j++) {
            dist_sorted.push_back({-A[i][j],{i,j}});
            ans += A[i][j];
        }
    
    sort(dist_sorted.begin(),dist_sorted.end());

    
    for(int i=0;i<dist_sorted.size();i++) {
        int u=dist_sorted[i].second.first;
        int v=dist_sorted[i].second.second;
        
        bool can = false;
        for(int w=1;w<=N;w++) {
            if (A[u][w]+A[w][v] < A[u][v])
                return -1;
            if (w != u && w != v && A[u][w]+A[w][v]==A[u][v]) {
                can=true;
            }
        }
        
        if (can) {
            ans -= A[u][v];
        }
        
        
        
    }
    
    return ans;
    
}

int main() {
    int N;
    cin>>N;
    for(int i=1;i<=N;i++)
        for(int j=1;j<=N;j++) {
            cin>>A[i][j];
            //A[i][j]=(i==j?0:1);
        }
    
    cout << Solve2(N) << endl;
    
}

Measured memory_bytes: 1784
# 2019/06/02
# AtCoder Grand Contest 034 - A

# For the answer:
# 1-1. Search min(ac) and max(abcd)
# 1-2. Search ## between min and max
# 2. Case:B<C, Left of B is . and (. or C), or exist .. -> Yes

# Def 1 : True is "Case No"
def searchRock(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 1): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg:
            rcflg = True
            break
    return rcflg

def searchPlain(in_l, in_r, in_str, in_tg):
    rcflg = False
    for i in range(in_l - 1, in_r - 1): # Change -2 -> -1
        if in_str[i] == in_tg and in_str[i+1] == in_tg and in_str[i+2] == in_tg:
            rcflg = True
            break
    return rcflg

# Input
n, a, b, c, d = map(int, input().split())
s = input()
ans = ""

# 1. Search ##
if c < b:
    # Search between a and c, b and d
    rflg = searchRock(a, c+1, s, "#")
    if rflg == True:
        ans = "No"
    else:
        rflg = searchRock(b, d+1, s, "#")
        if rflg == True:
            ans = "No"

else:
    # Search between a and max(c, d)
    rflg = searchRock(a, max(c, d)+1, s, "#")
    if rflg == True:
        ans = "No"
    
# 2. Check around b
if ans != "No":
    if (b < c and d < c):
        # Case: B < D < C 
        pflg = searchPlain(b-1, d, s, ".")
        if pflg == False:
            ans = "No"
#            if s[b-2] == "." and s[b] == ".":
#                ans = "Yes"
#            else:
#                ans = "No"
        else:
            ans = "Yes"
    else:
        ans = "Yes"

# Output
print(ans)


Measured memory_bytes: 3700
//@mangesh2102000

#include<bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ld long double
#define pb push_back
#define tr(c,it) for(auto it = (c).begin(); it != (c).end(); ++it)
#define F first
#define S second
#define MOD 1000000007

ll a[300001];
ll smax[300001];
ll smin[300001];

int main()
{
    IOS;
    ll n,sum=0;cin >> n;
    
    priority_queue < ll, vector<ll>, greater<ll> > start;
    priority_queue < ll, vector<ll>, less<ll> > end;
    
    for(ll i=0;i<3*n;i++)
    {
        cin >> a[i];
    }
    
    for(ll i=0;i<n;i++)
    {
        start.push(a[i]);
        sum+=a[i];
    }
    smax[n-1]=sum;
    for(int i=n;i<2*n;i++)
    {
        ll tmp = start.top();
        if(a[i]>tmp)
        {
            start.pop();
            sum -= tmp;
            sum += a[i];
            start.push(a[i]);
        }
        smax[i] = max(smax[i-1],sum);
    }
    
    sum=0;
    for(ll i=3*n-1;i>=2*n;i--)
    {
        end.push(a[i]);
        sum+=a[i];
    }
    smin[2*n]=sum;
    
    for(int i=2*n-1;i>=n;i--)
    {
        ll tmp = end.top();
        if(a[i]<tmp)
        {
            end.pop();
            sum -= tmp;
            sum += a[i];
            end.push(a[i]);
        }
        smin[i] = min(smin[i+1],sum);
    }
    
    ll ans = -1*(1e18);
    for(int i=n-1;i<2*n;i++)
    {
        ans = max(ans,smax[i]-smin[i+1]);
    }  
    
    cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 7796
#include <algorithm>
#include <cstring>
#include <utility>
#include <cstdio>
#include <queue>
std::priority_queue<std::pair<int, int> > que;
int a[100005], b[100005], c[100005], pre[100005], lst[100005];
int ans[100005], flg[100005];
bool up[100005];
int main()
{
	// freopen("AGC013-F.in", "r", stdin);
	// freopen("AGC013-F.out", "wt", stdout);
	memset(lst, -1, sizeof(lst));
	int n, q, lazy = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d%d", a + i, b + i);
	for (int i = 1; i <= n + 1; i++)
		scanf("%d", c + i);
	scanf("%d", &q);
	std::sort(c + 1, c + n + 2);
	for (int i = 0; i < n; i++)
	{
		a[i] = std::lower_bound(c + 1, c + n + 2, a[i]) - c;
		b[i] = std::lower_bound(c + 1, c + n + 2, b[i]) - c;
		flg[a[i] - 1]--;
		if (b[i] < a[i])
		{
			pre[i] = lst[a[i] - 1];
			lst[a[i] - 1] = i;
		}
		up[i] = true;
	}
	for (int i = n + 1, cur = -1; i; i--, cur++)
	{
		cur += flg[i];
		for (int j = lst[i]; ~j; j = pre[j])
			que.push({ -b[j], j});
		while (cur < -1)
		{
			if (que.empty() || -que.top().first > i)
			{
				while (q--)
					puts("-1");
				return 0;
			}
			up[que.top().second] = false;
			flg[-que.top().first - 1]--;
			que.pop();
			cur++;
			lazy++;
		}
	}
	memset(flg, 0, sizeof(flg));
	memset(lst, -1, sizeof(lst));
	while (!que.empty())
		que.pop();
	for (int i = 0; i < n; i++)
	{
		flg[up[i] ? a[i] : b[i]]++;
		if (up[i])
		{
			pre[i] = lst[b[i]];
			lst[b[i]] = i;
		}
	}
	for (int i = 1, en = 0; i <= n + 1; i++)
	{
		flg[i] += flg[i - 1];
		ans[i] = ans[i - 1];
		for (int j = lst[i]; ~j; j = pre[j])
			que.push({a[j] - 1, j});
		if (flg[i] - i == -1 && en < i)
		{
			if (que.empty() || que.top().first < i)
				ans[i] = 1e9;
			else
			{
				en = que.top().first;
				que.pop();
				ans[i]++;
			}
		}
	}
	while (q--)
	{
		int l, r;
		scanf("%d%d", &l, &r);
		l = std::lower_bound(c + 1, c + n + 2, l) - c;
		r = std::lower_bound(c + 1, c + n + 2, r) - c;
		int res = std::min(ans[l - 1], ans[r - 1] + 1) + lazy;
		if (res > n + 1)
			puts("-1");
		else
			printf("%d\n", n + 1 - res);
	}
	return 0;
}


Measured memory_bytes: 4596
#include <stdio.h>
#include<stdlib.h>
#include <sysexits.h>
int main(void){
  int x,a,b,y,i;
  if(scanf("%d",&x)!=1){
exit(1);
}
  y=x;
  a=0;
  b=0;
  for(i=0;i<4;i++){
   b=y%10;
   if(b==2){
     a+=1;
   }
   y=y/10;
}
  printf("%d",a);
  return 0;
}




Measured memory_bytes: 128
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn permutations<T: Copy>(vs: &[T]) -> Vec<Vec<T>> {
    match vs.split_first() {
        None => vec![vec![]],
        Some((first, rest)) => permutations(rest)
            .into_iter()
            .flat_map(|r| {
                let mut inserted = vec![];
                for i in 0..r.len() + 1 {
                    let mut s = r.clone();
                    s.insert(i, *first);
                    inserted.push(s)
                }
                inserted
            })
            .collect(),
    }
}

fn main() {
    let (n, m) = scan!(usize, usize);
    let mut graph: Vec<Vec<usize>> = vec![vec![]; n + 1];
    for _ in 0..m {
        let (a, b) = scan!(usize, usize);
        graph[a].push(b);
        graph[b].push(a);
    }

    let perm = permutations(&(2..(n + 1)).collect::<Vec<usize>>());

    let mut ans = 0;
    for p in perm.iter() {
        let mut i = 1;
        let mut found = vec![];
        for &n in p.iter() {
            found.push(graph[i].iter().find(|&&r| r == n).is_some());
            i = n;
        }
        if found.iter().all(|&f| f) {
            ans += 1
        }
    }
    println!("{}", ans)
}


Measured memory_bytes: 4352
from collections import defaultdict
import sys
input = sys.stdin.readline

h, w, n = map(int, input().split())
d = defaultdict(int)
dx = [1, 1, 1, 0, 0, 0, -1, -1, -1]
dy = [1, 0, -1, 1, 0, -1, 1, 0, -1]
for i in range(n):
    a, b = map(int, input().split())
    for k in range(9):
        d[(a+dx[k], b+dy[k])] += 1

ans = [0] * 10
for a, b in d:
    if a <= 1 or b <= 1 or a > h-1 or b > w-1:
        continue
    ans[d[(a, b)]] += 1
ans[0] = (h-2) * (w-2) - sum(ans)

for ans_i in ans:
    print(ans_i)


Measured memory_bytes: 166860
import math
syojikinn = int(input())
kouka500 = syojikinn / 500
kouka500 = math.floor(kouka500)
syojikinn = syojikinn - kouka500 * 500
kouka5 = syojikinn / 5
kouka5 = math.floor(kouka5)
siawase = kouka500 * 1000 + kouka5 * 5
print(siawase)

Measured memory_bytes: 9164
#include<stdio.h>

int main(void){
    int x,y,kame=0,turu=0,score = 0;

    scanf("%d %d",&x,&y);

    for(kame = 0; kame <= x;kame++){
        for(turu = x;turu >= 0;turu--){
            if(kame * 4 + turu *2 == y && kame + turu == x){
                score = 1;
            }
        }
    }
    if(score == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
}

Measured memory_bytes: 1656
#!/usr/bin/env python3

n = int(input())
p = list(map(int, input().split()))

cur_min = p[0]
ans = 1
for k, v in enumerate(p):
    if k == 0: continue
    if v <= cur_min:
        ans += 1
    cur_min = min(cur_min, v)

print(ans)



Measured memory_bytes: 24744
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <cstdlib>
#include <map>
#include <string>

using namespace std;

typedef long long ll;
typedef long double ld;

const int N = 1e6 + 10;
const int EPS = 1e-9;
const ll MOD = 1e9 + 7;

void solve() {
	int a, b;
	cin >> a >> b;
	if (max(a, b) > 9) {
		cout << -1;
	}
	else {
		cout << a * b;
	}
}

int main() {
//	auto trash = freopen("a.in", "r", stdin);
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	solve();
}

Measured memory_bytes: 892
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]

AB.sort(reverse=True, key=lambda x:x[0]+x[1])

t = sum(x[0] for x in AB[0::2])
a = sum(x[1] for x in AB[1::2])

print(t-a)


Measured memory_bytes: 32224
import numpy as np

def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = np.array(InputToInt())
    ALL = np.sum(A)
    H = int(ALL/2)
    S = 0
    for i in range(N):
        oldS = S
        S += A[i]
        if S > H:
            print(min(ALL - oldS*2, S*2 - ALL))
            break


Measured memory_bytes: 21800
from collections import defaultdict

n = int(input())
A = list(map(int, input().split()))

cnt = 0
d = defaultdict(int)
# j - i = Ai + Aj --> i + Ai = j - Aj
for i in range(n):
    cnt += d[i - A[i]]
    d[i + A[i]] += 1

print(cnt)



Measured memory_bytes: 61592
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n, m, s, g1, g2;
    while(cin >> n >> m >> s >> g1 >> g2, n){
        s--; g1--; g2--;
        vector<vector<ll>> G(n, vector<ll>(n, INF<int>));
        for (int i = 0; i < m; ++i) {
            int u, v, c; cin >> u >> v >> c;
            G[u-1][v-1] = c;
        }
        for (int i = 0; i < n; ++i) {
            G[i][i] = 0;
        }
        for (int k = 0; k < n; ++k) {
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < n; ++j) {
                    G[i][j] = min(G[i][j], G[i][k]+G[k][j]);
                }
            }
        }
        ll ans = G[s][g1]+G[s][g2];
        for (int i = 0; i < n; ++i) {
            ans = min(ans, G[s][i]+G[i][g1]+G[i][g2]);
        }
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 3160
N,K = map(int,input().split())
TD = [list(map(int,input().split())) for _ in [0]*N]
TD.sort(key=lambda x:(-x[1],x[0]))
use = TD[:K]
var = set()
lock = []
unlock = []
for t,d in use:
    if t in var:
        unlock.append(d)
    else:
        var.add(t)
        lock.append(d)
unlock.sort(reverse=True)
Dscore = sum(lock) + sum(unlock)
v = len(var)
Vscore = v*v
ans = Dscore + Vscore
unused = TD[K:][::-1]
while unlock and unused:
    t,d = unused.pop()
    if t in var: continue
    trash = unlock.pop()
    var.add(t)
    lock.append(d)
    v += 1
    Dscore += d - trash
    Vscore = v*v
    ans = max(ans,Dscore + Vscore)
print(ans)

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

int main()
{
    int r, c, i, j, k, f;
    char p[101][101];
    cin >> r >> c;
    for(i=0; i<r; i++)
    {
        for(j=0; j<c; j++)
            cin >> p[i][j];
    }

    for(i=0; i<r; i++)
    {
        f=1;
        for(j=0; j<c; j++)
        {
            if(p[i][j]!='.')
                f=0;
        }
        if(f==1)
        for(j=0; j<c; j++)
            p[i][j]='0';
    }

    for(i=0; i<c; i++)
    {
        f=1;
        for(j=0; j<r; j++)
        {
            if(p[j][i]!='.' && p[j][i]!='0')
                f=0;
        }
        if(f==1)
        for(j=0; j<r; j++)
            p[j][i]='0';
    }
    for(i=0; i<r; i++)
    {
        f=1;
        for(j=0; j<c; j++)
        {
           if(p[i][j]!='0')
            {

                cout << p[i][j];
               f=0;
            }
        }
        if(f==0)
            cout << "\n";
    }


}


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

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

int main() {
    ll N, C;
    cin >> N >> C;

    vector<vector<ll>> ch(30,vector<ll>(100100,0));
    set<ll> se;
    for(int i=0;i<N;i++){
        ll s, t, c;
        cin >> s >> t >> c;
        c--; s--; t--;
        se.insert(c);
        ch[c][s]++;
        ch[c][t+1]--;
    }
    ll sz=30;
    ll ct=0;
    for(int i=0;i<sz;i++){
        if(se.find(i) == se.end()){
            ch.erase(ch.begin()+(i-ct));
            ct++;
        }
    }

    C = ch.size();

    for(int c=0;c<C;c++){
        for(int i=0;i<100000;i++){
            ch[c][i+1]+=ch[c][i];
        }
    }
    ll ans = 1;
    for(int t=0;t<100000;t++){
        ll tmp=0;
        for(int i=0;i<C;i++){
            if(ch[i][t]>0){
                tmp++;
            }
        }
        ans=max(ans,tmp);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 24576
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[8] = {1, -1, 0, 0, 1, 1, -1, -1};
ll d2[8] = {0, 0, 1, -1, 1, -1, 1, -1};

int main(){
    ll H, W;
    cin >> H >> W;
    VS s(H);
    rep(i, 0, H) cin >> s[i];
    rep(h, 0, H){
        rep(w, 0, W){
            if(s[h][w] == '#') continue;
            char cnt = '0';
            rep(i, 0, 8){
                ll nh = h + d1[i];
                ll nw = w + d2[i];
                if(nh < 0 || nw < 0 || nh >= H || nw >= W) continue;
                if(s[nh][nw] == '#') cnt++;
            }
            s[h][w] = cnt;
        }
    }

    rep(h, 0, H) cout << s[h] << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a[] = new int[5];
		int r[] = new int[5];
		TreeMap<Integer, Integer> map = new TreeMap();

		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
			r[i] = a[i]%10;
			int b =10;
			if (r[i] != 0) {
				b = 10-r[i];
				map.put(b, a[i]);
			}
		}
		int ans = 0;

		if (map.size() == 0) {
			for (int i = 0; i < a.length; i++) {
				ans += a[i];
			}
			System.out.println(ans);
			return;
		}

		int last = map.get(map.lastKey());
		int idx = 0;
		for (int i = 0; i < a.length; i++) {
			if(a[i] == last) {
				idx = i;
			}
		}




		for (int i = 0; i < a.length; i++) {
			if (i != idx) {
				if (a[i]%10 == 0) {
					ans += a[i];
				} else {
					ans += a[i]+ (10- r[i]);
				}
			}
		}
		ans += last;

		System.out.println(ans);
	}
}


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

#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define stringtovector(s, v) {for (int i = 0; i < (s).size(); ++i) v.push_back(s[i]);};
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;
const int mod = 1000000007;





int main() {
        ll a,b,c,d;
        cin >> a >> b >> c >> d;
        vector<ll> res;
        res.push_back(a*c);  res.push_back(a*d);  res.push_back(b*c);  res.push_back(b*d);
        if (a <= 0 && b >= 0) {
            res.push_back(0);
        }
        if (c <= 0 && d >= 0) {
            res.push_back(0);
        }
        sort(res.begin(), res.end());
        cout << res[res.size() - 1];
}





Measured memory_bytes: 3632
'use strict'

function main(input) {

    input = input.split(' ')
    const a = ~~input[0]
    const b = ~~input[1]

    let ans;
    if (b % a === 0) {
        ans = a + b
    }
    else {
        ans = b - a
    }
    console.log(ans)
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<stdio.h>
int main(void) {
	int c1, c5, c10, c50, c100, c500, s;
	scanf("%d %d %d %d %d %d", &c1, &c5, &c10, &c50, &c100, &c500);
	s = 1 * c1 + 5 * c5 + 10 * c10 + 50 * c50 + 100 * c100 + 500 * c500;
	if (s >= 1000) {
		printf("1\n");
	}
	else {
		printf("0\n");
	}
	return 0;
}

Measured memory_bytes: 584
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  int na, nb, m;
  cin >> na >> nb >> m;
  vector<int> a(na), b(nb);
  rep(i, na) cin >> a[i];
  rep(i, nb) cin >> b[i];
  vector<int> x(m), y(m), c(m);
  rep(i, m) {
    cin >> x[i] >> y[i] >> c[i];
    x[i]--, y[i]--;
  }

  int ans = *min_element(a.begin(), a.end()) + *min_element(b.begin(), b.end());
  rep(i, m) {
    int res = a[x[i]] + b[y[i]] - c[i];
    ans = min(ans, res);
  }
  cout << ans << endl;

  
  return 0;
}

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

int main(){
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    int w = tx-sx, h = ty-sy;

    int i;
    for(i = 0; i < h; i++)  cout << "U";
    for(i = 0; i < w; i++)  cout << "R";
    for(i = 0; i < h; i++)  cout << "D";
    for(i = 0; i < w; i++)  cout << "L";
    cout << "L";
    for(i = 0; i < h+1; i++)    cout << "U";
    for(i = 0; i < w+1; i++)    cout << "R";
    cout << "DR";
    for(i = 0; i < h+1; i++)    cout << "D";
    for(i = 0; i < w+1; i++)    cout << "L";
    cout << "U";

    cout << endl;
    return 0;
}

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

#define INF 1e9
using namespace std;

int main() {

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

    sort(A.begin(), A.end());

    int ans = abs(A[N-1] - A[0]);

    cout << ans << endl;
}

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

const int DEBUG = 0;

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define DEBUGP(val) cerr << #val << "=" << val << "\n"

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

const int N = 100100;

vector<PIL> g[N];

ll sgn[N], seg[N];
VL poss;
bool vis[N];
bool mess;
// x[v] = a * x[0] + b
void dfs(int v, ll a, ll b) {
  if (DEBUG) {
    DEBUGP(v);
    DEBUGP(a);
    DEBUGP(b);
  }
  if (vis[v]) {
    if (a == sgn[v]) {
      if (b != seg[v]) mess = 1;
      return;
    }
    if ((b - seg[v]) % (a - sgn[v]) != 0) {
      mess = 1;
    } else {
      if (DEBUG) {
        cerr << "v=" << v << " " << a<<"x+"<<b<<"="<<sgn[v]<<"x+"<<seg[v]<<endl;
      }
      poss.push_back(-(b - seg[v]) / (a - sgn[v]));
    }
    return;
  }
  sgn[v] = a;
  seg[v] = b;
  vis[v] = 1;
  for (PIL ws: g[v]) {
    int w = ws.first;
    ll s = ws.second;
    dfs(w, -a, s - b);
  }
}

const ll inf = 1e18;

int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  REP(i, 0, m) {
    int u, v;
    ll s;
    cin >> u >> v >> s;
    u--, v--;
    g[u].push_back(PIL(v, s));
    g[v].push_back(PIL(u, s));
  }
  dfs(0, 1, 0);
  if (mess) {
    cout << 0 << endl;
    return 0;
  }
  sort(poss.begin(), poss.end());
  poss.erase(unique(poss.begin(), poss.end()), poss.end());
  if (DEBUG) {
    for (int p:poss) cerr <<" " << p;
    cerr << endl;
  }
  if (poss.size() >= 1) {
    if (poss.size() >= 2) {
      cout << 0 << endl;
      return 0;
    }
    ll x = poss[0];
    bool ok = true;
    REP(i, 0, n) {
      if (sgn[i] * x + seg[i] <= 0) {
        ok = false;
      }
    }
    cout << (ok ? 1 : 0) << endl;
    return 0;
  }
  ll lo = 1, hi = inf;
  REP(i, 0, n) {
    if (sgn[i] == 1) {
      lo = max(lo, -seg[i] + 1);
    } else {
      hi = min(hi, seg[i] - 1);
    }
  }
  DEBUGP(lo);
  DEBUGP(hi);
  cout << (hi >= lo ? hi - lo + 1 : 0) << endl;
}


Measured memory_bytes: 15744
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
typedef long long ll;
using namespace std;

int main() {
	string s,t;
	cin>>s>>t;
	sort(s.begin(),s.end());
	sort(t.begin(),t.end());
	reverse(t.begin(),t.end());
	if(s<t){
		cout << "Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}


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

int main()
{
  int N, X, Y;
  cin >> N >> X >> Y;
  vector<int> ans(N - 1);
  for (int i = 1; i <= N; i++)
  {
    for (int j = i + 1; j <= N; j++)
    {
      int dist = min(j - i, abs(X - i) + abs(Y - j) + 1);
      ans.at(dist - 1) += 1;
    }
  }

  for (int i = 0; i < ans.size(); i++)
  {
    cout << ans.at(i) << endl;
  }
}


Measured memory_bytes: 256
from collections import deque
def bfs(sx, sy):
    d = [[-1 * float("inf")] * w for i in range(h)]
    dx = [1, 0, -1, 0]
    dy = [0, 1, 0, -1]
    que = deque([(sx, sy)])
    d[sx][sy] = 0
    while que:
        p = que.popleft()
        for i in range(4):
            nx = p[0] - dx[i]
            ny = p[1] - dy[i]
            if 0 <= nx < h and 0 <= ny < w and s[nx][ny] != "#" and d[nx][ny] == -1 * float("inf"):
                que.append((nx, ny))
                d[nx][ny] = d[p[0]][p[1]] + 1
    return max(map(max, d))
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
l = []
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            continue
        l.append(bfs(i, j))
print(max(l))

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize(2)
const int N = 222;
int f[2][N][N][N];
int n, m;
char mp[N][N];
int main(){
//	freopen("land.in", "r", stdin);
//	freopen("land.out", "w", stdout);
	cin>>n>>m;
//	memset(f, -1, sizeof(f));
	for(int i = 1;i <= n; i++){
		scanf("%s", mp[i] + 1);
	}
	for(int i = m;i >= 1; i--){
		for(int l = 1;l <= n; l++){
			for(int r = l;r <= n; r++){
				if(mp[l][i] != mp[r][i])break;
				f[0][l][r][i] = i;
				if(mp[l][i+1] == mp[l][i])f[0][l][r][i] = max(f[0][l][r][i+1], i);
			}
		}
	}
	int fl = 0;
	for(int ans = 0;ans <= 20; ans++){
//		printf("ans=%d f1n1=%d\n", ans, f[fl][1][n][1]);
		if(f[fl][1][n][1] == m){
			printf("%d\n", ans);
			return 0;
		}
		for(int i = 1;i <= m; i++){
			for(int l = 1;l <= n; l++){
//				printf("l=%d\n", l);
				for(int r = n;r >= l; r--){
//					if(!f[fl][l][r][i])continue;
					if(f[fl][l][r][i] == m){
						f[fl^1][l][r][i] = m;
						continue;
					}
					int F = f[fl][l][r][i];
					F = max(F, f[fl][l][r][F+1]);
					int L = l, R = r - 1, res = l;
//					printf("r=%d\n", r);
//					for(int x = l;x < r; x++){
//						printf("x=%d f=%d\n", x, min(f[fl][l][x][i], f[fl][x+1][r][i]));
//					}
					while(L <= R){
						int mid = (L + R) >> 1;
//						F = max(F, min(f[fl][l][mid][i], f[fl][mid+1][r][i]));
						if(f[fl][l][mid][i] > f[fl][mid+1][r][i])L = mid + 1, res = mid;
						else R = mid - 1;
					}
//					printf("r=%d res=%d\n", r, res);
//					if(res + 1 < r)res++;
					F = max(F, min(f[fl][l][res][i], f[fl][res+1][r][i]));
					if(res + 1 < r)++res, F = max(F, min(f[fl][l][res][i], f[fl][res+1][r][i]));
					f[fl^1][l][r][i] = F;
				}
			}
		}
		fl ^= 1;
	}
	return 0;
}

Measured memory_bytes: 75648
import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;

const long mod = 1_000_000_007;
void main(){
	int n = readln.chomp.to!int;
	long[] as = readln.chomp.split.to!(long[]);

	long m = 1;
	long ans;
	A: while(1){
		long x;
		foreach(a; as) if(a % 2 > 0) x += 1;
		x *= (n - x), x %= mod;
		x *= m, x %= mod;
		ans += x, ans %= mod;

		m *= 2, m %= mod;
		foreach(ref a; as) a /= 2;
		foreach(a; as) if(a > 0) continue A;
		break;
	}
	ans.writeln;
}


Measured memory_bytes: 20660
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define pb push_back
#define debug(x) cout << x << endl
#define fastio ios_base::sync_with_stdio(0), cin.tie(0)
#define PI acos(-1)
#define all(c) c.begin(), c.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
const LL INF64 = 1e18;

const int N = 1e5 + 5;

LL dp[N];
set<LL> change;

int main() {
	for (LL i = 0; i < N; i++) dp[i] = INF;
	dp[0] = 0;
	change.insert(1);
	LL now = 6;
	while (now < N) {
		change.insert(now);
		now *= 6;
	}
	now = 9;
	while (now < N) {
		change.insert(now);
		now *= 9;
	}
	LL n;
	scanf("%lld", &n);
	for (auto it : change) {
		for (LL j = it; j <= n; j++) {
			dp[j] = min(dp[j - it] + 1, dp[j]);
 		}
	}
	printf("%lld\n", dp[n]);
	return 0;
}
		

Measured memory_bytes: 1024
input()
t=list(map(int,input().split()))
m=int(input())
p=[];x=[]
for _ in range(m):
    P,X=map(int,input().split())
    p.append(P)
    x.append(X)
for i in range(m):
    print(sum(t)-t[p[i]-1]+x[i])

Measured memory_bytes: 3064
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque

INF = 1 << 50



def run():
    N,D = map(int, sysread().split())
    ans = 0
    for i in range(N):
        x,y = map(int, sysread().split())
        val = x**2 + y**2
        if val <= D**2:
            ans += 1
    print(ans)


if __name__ == "__main__":
    run()

Measured memory_bytes: 9240
#include <stdio.h>

int main()
{
	int n,m,l;
	int i,j,k;
	long long int A[100][100];
	long long int B[100][100];
	long long int sum;
	
	scanf("%d %d %d",&n,&m,&l);
	
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			scanf("%lld",&A[i][j]);
		}
	}
	
	for(i=0;i<m;i++){
		for(j=0;j<l;j++){
			scanf("%lld",&B[i][j]);
		}
	}
	for(i=0;i<n;i++){
		for(j=0;j<l;j++){
			sum = 0;
			for(k=0;k<m;k++){
				sum += A[i][k]*B[k][j];
			}
			printf("%lld",sum);
			if(j+1!=l){
				printf(" ");
			}
		}
		printf("\n");
	}
	return 0;
}

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

int main() {
  int n,k; cin >> n >>k;
  vector<double>p(n);
  rep(i,n){
    double P;
    cin >> P;
    p[i]=(P+1)/2;
  }
  vector<double>s(n+1);
  s[0]=0;
  rep(i,n)s[i+1]=s[i]+p[i];
  
  double ans=0;
  rep(i,n-k+1){
    double M =s[i+k]-s[i];
    if(ans<M)ans=M;
  }
  cout << fixed <<setprecision(6) <<ans << endl;
}

Measured memory_bytes: 3328
N,K=map(int,input().split())

num=[0]*(max(N+1,K))
for i in range(1,N+1):
    num[i%K]+=1
#print(num)
ans=0
for a in range(K):
    b=(K-a)%K#a=0なら0 a!=0ならk-aになる賢い手
    c=(K-a)%K
    if (b+c)%K!=0:
        continue
    else:
      	#print(a)
        ans+=num[a]*num[b]*num[c]
        #print(a,b,c)
print(ans)

Measured memory_bytes: 4596
#include<bits/stdc++.h>
using namespace std;
int main(){int n,i,j,mx=10000000;
           int d[101]={0};
           //memset(d,0,sizeof(d));
           cin>>n;
           int a[n+1];
           for(i=1;i<=n;i++){cin>>a[i];
                          for(j=1;j<=100;j++){
                            d[j]+=(j-a[i])*(j-a[i]);
                          }
                            }
           for(i=1;i<=100;i++){mx=min(mx,d[i]);}
           cout<<mx;
  return 0;}

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

int main() {
  int N;
  cin >> N;
  vector<string> blue(N);
  for (int i = 0; i < N; i++) {
    cin >> blue.at(i);
  }
  int M;
  cin >> M;
  vector<string> red(M);
  for (int i = 0; i < M; i++) {
    cin >> red.at(i);
  }
  int ben = 0;
  for (int i = 0; i < N; i++) {
    string x = blue.at(i);
    int ben_at_x = 0;
    for (int j = 0; j < N; j++) {
      if (blue.at(j) == x) {
        ben_at_x++;
      }
    }
    for (int j = 0; j < M; j++) {
      if (red.at(j) == x) {
        ben_at_x--;
      }
    }
  ben = max(ben, ben_at_x);
  }
  cout << ben << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication14
{
    class Program
    {
        static void Main()
        {
            int[,,] s = new int[4, 3, 10];
            int a = int.Parse(Console.ReadLine());
            for(int b = 0; b < a; b++)
            {
                int[] e = Console.ReadLine().Split().Select(int.Parse).ToArray();
                s[e[0]-1,e[1]-1,e[2]-1]+= e[3];
            }
            for(int c = 0; c < 4; c++)
            {
                for(int f = 0; f < 3; f++)
                {
                    for(int y = 0; y < 10; y++)
                    {
                       
                        Console.Write(" "+s[c,f,y]);
                    }
                    Console.WriteLine();
                }
                if (c != 3) Console.WriteLine("####################");
            }
        }
    }
}

Measured memory_bytes: 9632
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,s=0,t;
	cin>>a>>b>>c;
	for(d=1;d<=a;d++){
		cin>>t;
		if(t<b||t>=c){
			s++;
		}
	}
	cout<<s<<endl;
}

Measured memory_bytes: 256
import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

getParm :: IO [Int]
getParm = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

main :: IO ()
main = do
  [a,b] <- getParm
  print $ numOfPlndrm a b

numOfPlndrm
  :: Int -> Int -> Int
numOfPlndrm a b = length $ filter isP [a .. b]

isP 
  :: Int -> Bool
isP n = c == C.reverse c
  where
    c = C.pack $ show n

Measured memory_bytes: 1020
A, B, C, X, Y = list(map(int, input().split()))

#全部AとBで用意
ans = A * X + B * Y

if X > Y:
  X, Y = Y, X
  A, B = B, A

#全部ABで用意
ans = min(ans, Y * C * 2)

#少ないほうだけABで用意
ans = min(ans, X * C * 2 + (Y - X) * B)

print(ans)

Measured memory_bytes: 61912
#include <bits/stdc++.h>
//#include <atcoder/all>
#define ll long long int
#define MOD 1000000007
#define P pair<ll,ll>
#define INF 1000000000000000000

//using namespace atcoder;
using namespace std;

int main(void){
  ll w, h, n;
  cin >> w >> h >> n;
  
  vector<vector<ll>> t(h, vector<ll>(w, 0));

  for (int i = 0; i < n; i++){
    ll x, y, a;
    cin >> x >> y >> a;
    
    if (a == 1){
      for (int i = 0; i < h; i++){
        for (int j = 0; j < x; j++){
          t[i][j] = 1;
        }
      }
    }
    else if (a == 2){
      for (int i = 0; i < h; i++){
        for (int j = x; j < w; j++){
          t[i][j] = 1;
        }
      }
    }
    else if (a == 3){
      for (int i = 0; i < y; i++){
        for (int j = 0; j < w; j++){
          t[i][j] = 1;
        }
      }
    }
    else if (a == 4){
      for (int i = y; i < h; i++){
        for (int j = 0; j < w; j++){
          t[i][j] = 1;
        }
      }
    }
  }

  ll ans = 0;
  for (int i = 0; i < h; i++){
    for (int j = 0; j < w; j++){
      ans += 1 - t[i][j];
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3680
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll MOD = 1E+09 + 7;
const int INF = 1E09;
const int MAX_N = 200;

int d[MAX_N + 1][MAX_N + 1];

int N, M, R;

int dp[8][1 << 8], cmin[8][8];
int rt[8];

void warshall_floyd();

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

    cin >> N >> M >> R;

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

    fill(d[0], d[N + 1], INF);
    for (int i = 0; i < M; i++) {
        int s, t, c;
        cin >> s >> t >> c;
        d[s][t] = c;
        d[t][s] = c;
    }
    for (int i = 1; i <= N; i++) {
        d[i][i] = 0;
    }
    warshall_floyd();

    for (int i = 0; i < R; i++) {
        for (int j = 0; j < R; j++) {
            cmin[i][j] = d[rt[i]][rt[j]];
            cmin[j][i] = d[rt[j]][rt[i]];
        }
    }
    /*
    for (int i = 0; i < R; i++) {
        for (int j = 0; j < R; j++) {
            cout << "i = " << i << ", j = " << j << ", cmin = " << cmin[i][j] << "\n";
        }
    }
    */

    /*
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n";
        }
    }
    */

    fill(dp[0], dp[R], INF);
    for (int s = 1; s < (1 << R); s++) {
        for (int i = 0; i < R; i++) {
            if ((s >> i) & 1) {
                int t = s & ~(1 << i);
                if (t != 0) {
                    int res = INF;
                    for (int j = 0; j < R; j++) {
                        if ((t >> j) & 1) {
                            res = min(res, dp[j][t] + cmin[i][j]);
                        }
                    }
                    dp[i][s] = res;
                } else {
                    dp[i][s] = 0;
                }
            }
        }
    }
    /*
    for (int i = 0; i < R; i++) {
        for (int j = 0; j < (1 << R); j++) {
            cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n";
        }
    }
    */
    int ans = INF;
    for (int i = 0; i < R; i++) {
        ans = min(ans, dp[i][(1 << R) - 1]);
    }

    cout << ans << "\n";

    return 0;
}

void warshall_floyd()
{
    for (int k = 1; k <= N; k++) {
        for (int i = 1; i <= N; i++) {
            for (int j = 1; j <= N; j++) {
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
            }
        }
    }
}

Measured memory_bytes: 3768