akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using static System.Console;
using static System.Math;
using static MyIO;
using static MyUtil;

public class B
{
	public static void Main() => (new Solver()).Solve();
}

public class Solver
{
	public void Solve()
	{
		WriteLine((int)Pow(GetInt(), 3));
	}
}

public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt() => int.Parse(getArg());
	public static long GetLong() => long.Parse(getArg());
	public static double GetDouble() => double.Parse(getArg());
	public static decimal GetDecimal() => decimal.Parse(getArg());
	public static string GetString() => getArg();
	public static char GetChar() => getArg()[0];
	public static int[] GetInts(long N) => Enumerable.Range(0, (int)N).Select(_ => GetInt()).ToArray();
	public static long[] GetLongs(long N) => Enumerable.Range(0, (int)N).Select(_ => GetLong()).ToArray();
	public static double[] GetDoubles(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDouble()).ToArray();
	public static decimal[] GetDecimals(long N) => Enumerable.Range(0, (int)N).Select(_ => GetDecimal()).ToArray();
	public static string[] GetStrings(long N) => Enumerable.Range(0, (int)N).Select(_ => GetString()).ToArray();
}

public static class MyUtil
{
	public static void chmax<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) < 0)
			x = y;
	}

	public static void chmin<T>(ref T x, T y) where T : IComparable<T>
	{
		if(x.CompareTo(y) > 0)
			x = y;
	}

	public static void swap<T>(ref T x, ref T y)
	{
		T tmp = x;
		x = y;
		y = tmp;
	}
}


Measured memory_bytes: 16032
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie();
    int n;
    cin>>n;
    int l[n];\
    set<int> s;
    for(int i = 0; i < n; i++)
    {
        cin>>l[i];
    }
    long long ans = 0;
    for(int i = 0; i < n; i++)
        for(int j = i+1; j < n; j++)
            for(int k = j+1; k < n; k++)
            {
                if((l[i] != l[j] && l[j] != l[k] && l[i] != l[k]) && ((l[i] + l[j]) > l[k]) && ((l[i] + l[k]) > l[j]) && ((l[j] + l[k]) > l[i]))    ans += 1;
            }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
LL x;
int main() {
  ios::sync_with_stdio(false);
  cin>>x;LL t=100;
  for(int i=1;;i++){
    t=t*1.01;
    if(t>=x)return cout<<i<<endl,0;
  }
  return 0;
}

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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using llong = long long;
using P = pair<int, int>;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

int main() {
   int n;
   cin >> n;
   int taro, hanako;
   taro = hanako = 0;
   rep(i, n) {
      string t1, t2;
      cin >> t1 >> t2;
      if (t1 < t2)
         hanako += 3;
      else if (t1 == t2)
         hanako++, taro++;
      else
         taro += 3;
   }
   printf("%d %d\n", taro, hanako);
   return 0;
}


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

int main(){
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int adtime = min({(a-1)%10, (b-1)%10, (c-1)%10, (d-1)%10, (e-1)%10})+1;
  int ans = (a+9)/10*10+(b+9)/10*10+(c+9)/10*10+(d+9)/10*10+(e+9)/10*10-(10-adtime);
  cout << ans << endl;
}

Measured memory_bytes: 256
class fenwick_tree:
    def __init__(self, n):
        self.data = [0 for _ in range(n+1)]
        self.n = n

    def add(self, p, x):
        p += 1
        while p <= self.n:
            self.data[p-1] += x
            p += p & -p
    
    def sum(self, l, r):
        return self._sum(r) - self._sum(l)

    def _sum(self, r):
        s = 0
        while r > 0:
            s += self.data[r-1]
            r -= r & -r
        return s
    
N, Q = [int(_) for _ in input().split()]

fw = fenwick_tree(N)
A = [int(_) for _ in input().split()]
for i, a in enumerate(A):
    fw.add(i, a)

for i in range(Q):
    t, *q = [int(_) for _ in input().split()]
    if t == 0:
        p, x = q
        fw.add(p, x)
    else:
        l, r = q
        print(fw.sum(l, r))
        

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const double PI = 3.14159265358979;

// 最大公約数 : 3,4 ->  1
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

// Sieve of Eratosthenes
// https://youtu.be/UTVg7wzMWQc?t=2774
struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
  vector<pair<ll,int>> factor(ll x) {
    vector<pair<ll,int>> res;
    for (int p : primes) {
      int y = 0;
      while (x%p == 0) x /= p, ++y;
      if (y != 0) res.emplace_back(p,y);
    }
    if (x != 1) res.emplace_back(x,1);
    return res;
  }
};

void solve()
{
  ll n;
  cin >> n;
  vector<ll> a(n);
  vector<ll> facs(1000010, 0);
  Sieve si(1000010);
  int cnt = 0;
  for(int i = 0; i < n; ++i)
  {
    cin >> a[i];
    if (a[i] == 1)cnt++;
  }
  sort(ALL(a));
  a.erase(unique(ALL(a)), a.end());
  ll old_n = n;
  n = a.size();

  ll check = a[0];
  for(const auto& va : a)
  {
    check = gcd(check, va);
  }

  if (check >= 2)
  {
    cout << "not coprime";
    return;
  }

  if (old_n != n)
  {
    if (cnt >= 2 && n + cnt - 1 == old_n)
    {

    }
    else
    {
      cout << "setwise coprime";
      return;
    }
    
  }

  for(const auto& va : a)
  {
    if (si.isPrime(va))
    {
      facs[va]++;
      if (facs[va] >= 2)
      {
        cout << "setwise coprime";
        return;  
      }
    }
    else
    {
      for(const auto& v : si.factor(va))
      {
        facs[v.first]++;
        if (facs[v.first] >= 2)
        {
          cout << "setwise coprime";
          return;  
        }
      }
    }
  }
  cout << "pairwise coprime";
}

int main()
{
  fastio;
  solve();

  return 0;
}

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

public class Main {

	static final int P = 998244353;

	HashMap<String, Integer> map = new HashMap<>();

	int go(String s) {
		if (s.isEmpty()) {
			return 1;
		}
		if (map.containsKey(s)) {
			return map.get(s);
		}

		long ret = (long) (1 + s.charAt(0) - '0') * go(s.substring(1)) % P;
		for (int x = 1; 2 * x <= s.length(); x++) {
			char[] buf = s.substring(0, x).toCharArray();
			for (int k = 2; x * k <= s.length(); k++) {
				for (int i = 0; i < x; i++) {
					if (s.charAt((k - 1) * x + i) == '0') {
						buf[i] = '0';
					}
				}
				ret += (long) go(new String(buf)) * go(s.substring(k * x)) % P;
			}
		}

		int iret = (int) (ret % P);
		map.put(s, iret);
		return iret;
	}

	void submit() {
		String s = nextToken();
		out.println(go(s));
	}

	void preCalc() {

	}

	void stress() {

	}

	void test() {

	}

	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		preCalc();
		submit();
		// stress();
		// test();
		out.close();
	}

	static final Random rng = new Random();

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;

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

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}
}


Measured memory_bytes: 122556
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
#define ll long long int

int		main(void)
{
	unsigned ll x;
	unsigned ll ans = 0;
	scanf("%lld", &x);
	ans += (x / 500) * 1000;
	x %= 500;
	ans += (x / 5) * 5;
	cout << ans << '\n';
	return (0);
}


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

int main()
{
	int n,m;
	cin >> n >> m;
	vector<pair<ll,ll>> vp;
	for(int i = 0;i<n;i++)
	{
		int x;cin >> x;
		vp.emplace_back(x,1);
	} 
	for(int i = 0;i<m;i++)
	{
		int x,y;
		cin >> x >> y;
		vp.emplace_back(y,x);
	}
	sort(vp.begin(),vp.end(),greater<>());
	ll ans = 0;
	int N = n;
	for(int i = 0;i<N+m;i++)
	{
		if(n>=vp[i].second)
		{
			ans += vp[i].second*vp[i].first;
			n-=vp[i].second;
		}
		else
		{
			ans += vp[i].first*n;
			n=0;
		}
		//cout<<ans<<endl;
		if(n==0)break;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 6000
short S[40][2];i,f,h,p,t,d,e;M(int*a){return*1[&a]-*a;}main(m){for(;~scanf("%d",&m);){for(i=m;i--;)for(S[i][scanf("%d",S[i])]=t=p=d=h=f=0;h<3;f==9?h+=h-1|d+e>9?1:2:!h&d>9?f+=t=1:(h^=1)|d+e<=9?f+=h^1:(p++,f++))e=d,scanf("%d",&d),S[i][1]+=~(t+p)*d,p=t,t=0;for(qsort(S,m,4,M);m--;)printf("%d %d\n",S[m][0],-S[m][1]);}}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false), cin.tie(0)
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ALL(x) (x).begin(), (x).end()
#define dump(x) cout << (x) << endl
#define LMAX 9223372036854775807LL
#define LMIN -9223372036854775807LL
using ll = int64_t;
template<typename T>
using vec = vector<T>;
using P = pair<ll, ll>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
	fill((T *)array, (T *)(array + N), val);
}

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//ll pas[5001][5002];
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a % b);
}
signed main(){
	IOS;
	ll n, x;
	cin >> n >> x;
	ll ans = 3 * (n - gcd(n,x));
	dump(ans);
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(void){
    int x[5];
    int i;
    
    for(i=0;i<5;i++){
        scanf("%d",&x[i]);
    }
    
    for(i=0;i<5;i++){
        if(x[i]==0){
            printf("%d\n",i+1);
            exit(0);
        }
    }
    
    return 0;
}


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

using namespace std;
#define int long long
#define mp make_pair
#define pb push_back


const int inf = 1e18;
const double EPS = 0.00000001;

signed main(){
    int n;
    cin >> n;
    int mass[n];
    for(int i =0;i<n;i++) cin >> mass[i];
    int cnt = 1;
    set<int> s;
    s.insert(mass[0]);
    for(int i =1;i<n;i++){
        int x= *s.begin();
        if(x >= mass[i]){
            cnt++;
        }
        s.insert(mass[i]);
    }
    cout << cnt;
}


Measured memory_bytes: 14544
from collections import deque

N, M = map(int, input().split())
to = [[] for i in range(N+1)]
#dist = [100001 for i in range(N+1)]
flug = [0 for i in range(N+1)]

to[0].append(1)
#dist[0] = 0

for i in range(M):
    a, b = map(int, input().split())
    to[a].append(b)
    to[b].append(a)

q = deque([0])
while (len(q) != 0):
    i = q.popleft()
    for j in to[i]:
        if flug[j] == 0:
#            dist[j] = dist[i] +1
            flug[j] = i
            q.append(j)

print("Yes")
for i in range(2,N+1):
    print(flug[i])


Measured memory_bytes: 34228
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

int main()
{
    int n;
    while(~scanf("%d", &n))
    {
        int a[105];
        for(int i = 0; i < n; i++)
            scanf("%d", &a[i]);
        int ans = 1e9;
        for(int i = -100; i <= 100; i++)
        {
            int tmp = 0;
            for(int j = 0; j < n; j++)
                tmp += (a[j] - i)*(a[j] - i);
            ans = min(ans, tmp);
        }
        printf("%d\n", ans);
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
using ll = long long;

ll egcd(ll a, ll b) {
  if(a < b) return egcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

ll lcm(ll a, ll b) {
  return (a*b) / egcd(a,b);
}

int main() {
    ll n,m,gc,lc;
    cin >> n >> m;
    string s,t;
    cin >> s >> t;
    bool f=true;
    if (s[0]!=t[0]) { f = false; }
    else {
        gc = egcd(n,m);
        lc = lcm(n,m);
        if (gc==1) {
        }
        else {
            vector<char> ss(lc,'-'),tt(lc,'-');
            for (int i=0;i<s.length();i++) ss[lc/n*i] = s[i];
            for (int j=0;j<t.length();j++) tt[lc/m*j] = t[j];
            ll id,t=lc/gc;
            for (int i=0;i<gc;i++) {
                id = t * i;
                if (ss[id] != tt[id]) {f = false;;break;}
            }
        }
    }
    cout << (f ? lc : -1) << endl;
    return 0;
}

Measured memory_bytes: 46592
#include <iostream>
#include <vector>
using namespace std;
using uint = unsigned int;

int main() {
	uint N, M;
	cin >> N >> M;
	
	vector<bool> AC(N);
	vector<uint> WA(N);
	
	for(uint i=0; i<M; i++) {
		uint p;
		string S;
		cin >> p;
		cin	>> S;
		
		p--;
		
		if(!AC[p] && (S == "WA")) {
			WA[p]++;
		}
		
		AC[p] = AC[p] | (S == "AC");
	}
	
	uint WAs = 0;
	uint ACs = 0;
	
	for(uint i=0; i<N; i++) {
		ACs = AC[i] ? ACs + 1 : ACs;
		WAs = AC[i] ? WAs + WA[i] : WAs;
	}
	
	cout << ACs << " " << WAs << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using i64 = long long;

int main() {
    i64 a, b, c;
    std::cin >> a >> b >> c;
    if (c <= a + b) std::cout << c + b << std::endl;
    else std::cout << b + (a + b + 1) << std::endl;

    return 0;
}

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

using namespace std;
int main() {
    int N;
    string S;
    int cnt = 0;

    cin >> S;
    N = S.size();

    for (int i = 0; i < N; i++) {
        if (S[i] == '0') cnt++;
        else cnt--;
    }

    cout << N - abs(cnt) << endl;
    return 0;
}


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

int main(void){

  double xa, ya, xb, yb;
  double x = 0;
  double y = 0;
  double xxyy= 0;
  double xy = 0;
  
  scanf("%lf%lf%lf%lf", &xa, &ya, &xb, &yb);

  x = xa - xb;
  y = ya - yb;
  xxyy = x*x + y*y;
  xy = sqrt(xxyy);

  printf("%f\n", xy);
  return 0;
}

Measured memory_bytes: 652
#define dbg(...) "amit_dwivedi"
#define db(...)  "Too OP"
#include "bits/stdc++.h"        
using namespace std;using ll=long long;
void sol(){
    ll n;cin>>n;
    vector<ll> a(n);
    for(int i = 0;i<n;i++)
        cin>>a[i];
    map<ll,ll> l,r;
    for(int i = 0;i < n; i++){
        l[i+a[i]]++;
        r[i-a[i]]++;
    }
    ll ans = 0;
    for(int i = 0;i < n; i++){
        ans += l[i]*r[i];
    }
    cout << ans << endl;
}
int main(){
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    // int t;cin>>t;while(t--)
    sol();
}
 

Measured memory_bytes: 47400
//#define NDEBUG
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <utility>
#include <vector>

namespace n91 {

  using i8 = std::int_fast8_t;
  using i32 = std::int_fast32_t;
  using i64 = std::int_fast64_t;
  using u8 = std::uint_fast8_t;
  using u32 = std::uint_fast32_t;
  using u64 = std::uint_fast64_t;
  using isize = std::ptrdiff_t;
  using usize = std::size_t;

  struct rep {
    struct itr {
      usize i;
      constexpr itr(const usize i) noexcept : i(i) {}
      void operator++() noexcept { ++i; }
      constexpr usize operator*() const noexcept { return i; }
      constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
    };
    const itr f, l;
    constexpr rep(const usize f, const usize l) noexcept
      : f(std::min(f, l)), l(l) {}
    constexpr auto begin() const noexcept { return f; }
    constexpr auto end() const noexcept { return l; }
  };
  struct revrep {
    struct itr {
      usize i;
      constexpr itr(const usize i) noexcept : i(i) {}
      void operator++() noexcept { --i; }
      constexpr usize operator*() const noexcept { return i; }
      constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
    };
    const itr f, l;
    constexpr revrep(const usize f, const usize l) noexcept
      : f(l - 1), l(std::min(f, l) - 1) {}
    constexpr auto begin() const noexcept { return f; }
    constexpr auto end() const noexcept { return l; }
  };
  template <class T> auto md_vec(const usize n, const T& value) {
    return std::vector<T>(n, value);
  }
  template <class... Args> auto md_vec(const usize n, Args... args) {
    return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
  }
  template <class T> constexpr T difference(const T& a, const T& b) noexcept {
    return a < b ? b - a : a - b;
  }
  template <class T> void chmin(T& a, const T& b) noexcept {
    if (b < a)
      a = b;
  }
  template <class T> void chmax(T& a, const T& b) noexcept {
    if (a < b)
      a = b;
  }
  template <class F> class rec_lambda {
    F f;

  public:
    rec_lambda(F&& f) : f(std::move(f)) {}
    template <class... Args> auto operator()(Args&&... args) const {
      return f(*this, std::forward<Args>(args)...);
    }
  };
  template <class F> auto make_rec(F&& f) { return rec_lambda<F>(std::move(f)); }
  template <class T> T scan() {
    T ret;
    std::cin >> ret;
    return ret;
  }
  constexpr char eoln = '\n';
  template <class T> T ceildiv(const T& l, const T& r) {
    return l / r + (l % r != 0 ? 1 : 0);
  }

} // namespace n91

namespace n91 {

  void main_() {
    /*
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    //*/
    const std::string s = scan<std::string>();
    for (auto e : s) {
      if (e == '?') {
        e = 'D';
      }
      std::cout << e;
    }
  }

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Measured memory_bytes: 3752
#include <iostream>
using namespace std;
 
#define check cnt=0;for(j=0;j<6;j++)if(d[q][j]==d[r][j])cnt++;
#define m tmp=d[r][1];d[r][1]=d[r][3];d[r][3]=d[r][4];d[r][4]=d[r][2];d[r][2]=tmp;
#define y tmp=d[r][0];d[r][0]=d[r][3];d[r][3]=d[r][5];d[r][5]=d[r][2];d[r][2]=tmp;
 
bool same(int d[][6],int q,int r){
 int tmp,cnt,j,a=1,i,k;
 check
   if(cnt==6)a=0;
 
 while(a){
  for(i=0;i<5;i++){
   for(k=0;k<4;k++){
    check
    if(cnt==6)break;
    m
   }
   check
   if(cnt==6)break;
   tmp=d[r][0];
   d[r][0]=d[r][1];
   d[r][1]=d[r][5];
   d[r][5]=d[r][4];
   d[r][4]=tmp;
  }
  if(cnt==6)break;
  y
  for(k=0;k<4;k++){
   check
   if(cnt==6)break;
   m
  }
  check
  if(cnt==6)break;
  y
  y
  for(k=0;k<4;k++){
   check
   if(cnt==6)break;
   m
  }
  a=0;
 }
 
 if(cnt==6)return true;
 return false;
 
}
 
 
int main(){
 int n,judge=0;
 
 cin >> n;
 
 int d[n][6];
 
 for(int i=0;i<n;i++){
  for(int j=0;j<6;j++){
   cin >> d[i][j] ;
  }
 }
 
 for(int q=0;q<n-1;q++){
  for(int r=q+1;r<n;r++){
  if(same(d,q,r))judge++;
  }
 }
 if(judge>0)cout << "No" << endl ;
 else cout << "Yes" << endl ;
 
 return 0;
}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

ll dfs(ll n,ll x,vl s,vl S){ //層の段,残り層数
    if(n==0)return 1;
    else if(x==1)return 0;
    else if(x>1 && x<= 1+s[n-1])return dfs(n-1,x-1,s,S);
    else if(x==2+s[n-1])return (1+S[n-1]);
    else if(x>2+s[n-1] && x<3+2*s[n-1])return S[n-1]+1+dfs(n-1,x-2-s[n-1],s,S);
    else return (1+2*S[n-1]);
}
signed main()
{   
    gearup;
    int x; cin >> x;
    if(x == 3 || x == 5 || x == 7)cout << "YES" << endl;
    else cout << "NO" << endl;
}


Measured memory_bytes: 256
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

if a[0] - b[0] == a[1] - b[1] == a[2] - b[2]:
    if  b[0] - c[0] == b[1] - c[1] == b[2] - c[2]:
        print("Yes")
        exit()
    else:
        pass

print("No")

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

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

    cout << (s == "AAA" || s == "BBB" ? "No" : "Yes") << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<string> s(N);
  for(int i=0; i<N; i++){
    cin >> s.at(i);
  }
  int M;
  cin >> M;
  vector<string> t(M);
  for(int i=0; i<M; i++){
    cin >> t.at(i);
  }
  
  int ma=0;
  int cnt;
  for(int i=0; i<N; i++){
    cnt = 0;
    for(int j=0; j<N; j++){
      if(s.at(i) == s.at(j)){
        cnt++;
      }
    }
    for(int k=0; k<M; k++){
      if(s.at(i) == t.at(k)){
        cnt--;
      }
    }
    ma = max(ma,cnt);
  }
  cout << ma << endl;
}

Measured memory_bytes: 256
use proconio::{input, fastout};
use proconio::marker::{Chars};
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
  }

#[fastout]
fn main() {
    input!{
        n: Chars,
    }

    let jikai: String = n.iter().collect();
    let jikai_num: usize= jikai.parse().unwrap();
    let first = n[0];
    let sanka: String = [n[0],n[0],n[0]].iter().collect();
    let sanka_num: usize = sanka.parse().unwrap();

    if jikai_num <= sanka_num {
        println!("{}", sanka_num);
    } else {
        println!("{}", sanka_num+111);
    }
}


Measured memory_bytes: 2044
function Main(input) {
  input=input.split("\n");
  if(input[input.length-1]===''){
    input.pop();
  }
  const H=input[0].split(' ')[0]-0;
  const N=input[0].split(' ')[1]-0;
  const A=input[1].split(' ').map(e=>{
    return e-0;
  });
  
  console.log(A.reduce((acc,cur)=>{return acc+cur;})>=H?'Yes':'No');

}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  



  


Measured memory_bytes: 37452
# include <bits/stdc++.h>
# define rr
const int N=100010,INF=0x3f3f3f3f;
bool use[N];
int n;
int ans;
int k;
inline int read(void){
	int res,f=1;
	char c;
	while((c=getchar())<'0'||c>'9')
		if(c=='-')f=-1;
	res=c-48;
	while((c=getchar())>='0'&&c<='9')
		res=res*10+c-48;
	return res*f;
}
int main(void){
	n=read(),k=read();
	while(k--){
		int sum=read();
		for(rr int i=1;i<=sum;++i){
			use[read()]=true;
		}
	}
	for(rr int i=1;i<=n;++i){
		ans+=!(use[i]);
	}
	std::cout<<ans;
	return 0;
}


Measured memory_bytes: 3636
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int H = sc.nextInt();
		int M = sc.nextInt();
		double radB = M * 6.0;
		double radA = 30.0 * H + 30.0 * (radB / 360.0);
		double rad;
		if(Math.abs(radA - radB) > 180){
			rad = 360 - Math.abs(radA - radB);
		}else{
			rad = Math.abs(radA - radB);
			}
		double C = Math.PI * (rad / 180);
		double ans = Math.sqrt(A * A + B * B - 2 * A * B * Math.cos(C));
		System.out.println(ans);
	}
}

Measured memory_bytes: 27188
#include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      int n, k, x=1;
      cin >> n >> k;
      
      for (int i=0; i < n; i++){
        
        if (x > k){
          x += k;
        }
        else {
          x *= 2;
        }
        
      }
      
      cout << x << endl;
      
    }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,k,d,ak,c=0; cin>>n>>k;
  int a[n]={0};
  while(k--){
    cin>>d;
    while(d--) cin>>ak,a[--ak]++;
  }
  for(int i:a) if(!i) c++;
  cout<<c;
}

Measured memory_bytes: 3588
N,W = map(int,input().split())
w,v = [0 for _ in range(N)], [0 for _ in range(N)]
for i in range(N):
    w[i],v[i] = map(int,input().split())
# dp[i][w] = [合計重さ,重さw で得られる最大の価値v]
dp = [[0 for _ in range(W+1)] for i in range(N+1)]

for i in range(N):
    for sum_w in range(W+1):
        if sum_w - w[i] >= 0:
            dp[i+1][sum_w] = max(dp[i][sum_w], dp[i][sum_w - w[i]] + v[i])
        dp[i+1][sum_w] = max(dp[i+1][sum_w],dp[i][sum_w])

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

Measured memory_bytes: 217772
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
/*answer*/
    int n;
    int[] a;
    long res;
    int i, min, max;

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

    res = 0;
    min = a[0];
    max = a[0];
    for(i = 0;i < n;i++){
      if(min > a[i])min = a[i];
      if(max < a[i])max = a[i];      
      res += (long)a[i];
    }

    System.out.println(min + " " + max + " " + res);

    sc.close();
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
}

Measured memory_bytes: 31752
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    string s;
    ll q;
    cin >> s >> q;
    int count_of_reverse = 0;
    string left,right;
    int is_reversed = 0;
    REP(i,q){
        int t;
        cin >> t;
        
        if(t == 1){
            is_reversed = is_reversed^1;
            count_of_reverse++;
        }
        if(t == 2){
            int f;
            string c;
            cin >> f >> c;
            if(f == 1){
                if(is_reversed==0)
                    left = c+left;
                else
                    right = right+c;
            }
            if(f == 2){
                if(is_reversed == 0)
                    right = right+c;
                else
                {
                    left = c+left;
                }
            }
        }
    }
    string answer = left+s+right;
    if(count_of_reverse%2){
        reverse(ALL(answer));
    }
    cout << answer << endl;
    
    return 0;
}

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

using namespace std;

void solve();

int main() {
#ifdef OFFLINE
	freopen("input.txt", "r", stdin);
#endif
	ios::sync_with_stdio(false);
	solve();
	return 0;
}

typedef long long llong;
// #define int llong
#define forn(i, n) for (int i=0; i<(n); ++i)

const int N = 100000;
int a[N];
llong ans;

void solve() {
	int n; cin >> n;
	forn(i, n) cin >> a[i];
	ans = 0;
	forn(i, n - 1) {
		ans += a[i] / 2;
		if ((a[i] & 1) && a[i+1] > 0) {
			--a[i+1];
			++ans;
		}
	}
	ans += a[n-1] / 2;
	cout << ans << endl;
}

Measured memory_bytes: 640
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Node {
    int key;
    struct Node *right, *left, *parent;
};
typedef struct Node Node;

Node *root, *NIL;

//
Node * find(Node *u, int k) {
    while(u != NIL && k != u->key) {
        if(k < u->key) u = u->left;
        else u = u->right;
    }
    return u;
}
//

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;
    
    z = (Node *)malloc(sizeof(Node));
    z->key   = k;
    z->left  = NIL;
    z->right = NIL;
    
    while(x != NIL) {
        y = x;
        if(z->key < x->key) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
    
    z->parent = y;
    if(y == NIL) {
        root = z;
    } else {
        if( z->key < y->key) {
            y->left = z;
        } else {
            y->right = z;
        }
    }
}

void inorder(Node *u) {
    if(u == NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node *u) {
    if(u == NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}
    

//
int main(void) {
    int n, i, x;
    char com[16];
    scanf("%d",&n);
    
    for(i=0;i<n;i++) {
        scanf("%s",com);
        if(com[0] == 'f') {
            scanf("%d",&x);
            Node *t = find(root,x);
            if(t != NIL) printf("yes\n");
            else printf("no\n");
        } else if(!strcmp(com,"insert")) {
            scanf("%d",&x);
            insert(x);
        } else if(!strcmp(com,"print")) {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }

    return 0;
}




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

//read_editorial
int main() {
    int n;cin>>n;
    int a[n];rep(i,n)cin>>a[i];
    int l[n],r[n];
    l[0]=a[0];
    r[n-1]=a[n-1];
    rep(i,n-1)l[i+1]=__gcd(l[i],a[i+1]);
    rep(i,n-1)r[n-2-i]=__gcd(r[n-1-i],a[n-2-i]);
    
    int ans = 1;
    rep(i,n-2)ans=max(ans,__gcd(l[i],r[i+2]));
    ans=max(ans,l[n-2]);
    ans=max(ans,r[1]);
    cout<<ans<<endl;
	return 0;
}

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

using namespace std;

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

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

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

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

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

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

int n;
int a[125252];

int main(){
  scanf("%d",&n);
  REP(i,n)scanf("%d",a+i);
  ll ans = 0;
  int ban = 0;
  REP(i,n){
    ll k = ban+1;
    if(a[i]==k){
      ban = k;
      continue;
    }
    ans += (a[i]-1)/k;
    if(ban==0)ban=1;
  }
  printf("%lld\n",ans);
  return 0;
}


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

using namespace std;

int main()
{

	int r,D,x[2050];
	cin >> r >> D >> x[2000];

	for(int i=2001;i<=2010;i++)
	{
		x[i]=r*x[i-1]-D;
		cout << x[i] << endl;
	}



}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N; cin >> N;
    int boxes[N];
    for (int i = 0; i < N; i++) {
        cin >> boxes[i];
    }

    string ans; ans = "Yes";
    for (int i = N - 1; i > 0; i--) {
        int* prev = &boxes[i - 1];
        int* next = &boxes[i];
        if (*prev > *next + 1) {
            ans = "No";
            break;
        } else if (*prev == *next + 1) {
            *prev -= 1;
        } else {
            continue;
        }
    }
 
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 640
n,m = map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=1)
use_list = [2,5,5,4,5,6,3,7,6]

ans = [-1]*(n+1)
ans[0] = 0
for a in A:
	ma = use_list[a-1]
	for i in range(n+1):
		if ans[i] == -1:
			continue
		if i+ma > n:
			break
		ans[i+ma] = max(ans[i+ma],ans[i]*10+a)
print(ans[n])

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

using namespace std;
 
 


//c++ templte for help............................................................................................................................................

typedef long long ll;

template<typename... T>
void print1(T... t){
	((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
		vector<vector<ll>> ans={t...};
		for(ll i=0;i<(ll)ans.size();i++){
			if(i!=0) cout<<"\t\t";
			else cout<<"\t";
			for(ll j=0;j<(ll)ans[i].size();j++){
				cout<<ans[i][j]<<" ";
			}
			if(i!=(ll)ans.size()-1)
			cout<<endl;
		}
}	
#define deb(...) {cout<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cout<<"]"<<endl; }
#define vdeb(...) {cout<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cout<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
		vector<vector<ll>> ans={t...};
		for(ll i=0;i<(ll)ans.size();i++){
			for(ll j=0;j<(ll)ans[i].size();j++){
				retvec<<ans[i][j];
				if(j!=(ll)ans[i].size()-1)
					retvec<<" ";
			}
			if(i!=(ll)ans.size()-1)
				retvec<<endl;
		}
}
#define vret(...) {returnvector(__VA_ARGS__);return retvec.str();}
	


//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)
 
 
//to print vector element 
template<typename T>
void printV(T vec){
	fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
	cout<<endl;
	}
	
 
#define M ll(1e9+7)
const ll INF=ll(1e9+5);
 
//iterate map
template<typename T>
void itR(T map){
	 for(auto itr=map.begin();itr!=map.end();itr++){
				deb(itr->first,itr->second);
			}
	cout<<endl;
}

//c++ template for help...........................................................................................................................................

ll power(ll b,ll ind){
	ll ans=1;
	while(ind>0){
		if(ind%2!=0){
			ans=((ans%M)*(b%M))%M;
			ind--;
		}else{
			b=((b%M)*(b%M))%M;
			ind/=2;
		}
	}
	return ans%M;
}


string solve(){
	ll n;
	cin>>n;
	
	ret((power(10,n)%M-(2*power(9,n))%M+power(8,n)+M)%M);
}

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

	//ll testCase;
	//cin>>testCase;
	//for(ll tt=0;tt<testCase;tt++){
		string ans1=solve();
		if(ans1!="")
			cout<<ans1<<endl;
	//}
	return 0;
}


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

int const MAX = 2e5 + 5;
int ar[MAX], n, k, cnt[MAX];
int main(){
    cin >> n >> k;
    for (int i = 1; i <= n; i++){
        cin >> ar[i];
    }
    int bound = 41;
    if (k > bound){
        for (int i = 1; i <= n; i++){
            cout << n << " ";
        }
        cout << "\n";
    } else {
        for (int i =1; i <= k; i++){
            for (int j = 1; j <= n; j++){
                int l = max(1, j - ar[j]);
                int r = min(n, j + ar[j]);
                cnt[l] += 1;
                cnt[r + 1] -= 1;
            }
            for (int j = 1; j <= n; j++){
                cnt[j] += cnt[j - 1];
                ar[j] = cnt[j];
            }
            for (int j = 1; j <= n; j++)
                cnt[j] = 0;
        }
        for (int i = 1; i <= n; i++)
            cout << ar[i] << " ";
        cout << "\n";
    }
}

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

void solve(long long A, long long B) {
    set<ll> s;
    s.insert(1);
    s.insert(2);
    s.insert(3);
    s.erase(A);
    s.erase(B);
    cout << *s.begin() << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can
// remove this line by using your custom template)
int main() {
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}


Measured memory_bytes: 3668
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<tuple>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
int main(){
    int a;
    cin>>a;
    vector<int> v;
    int d;
    rep(i, a){
        cin>>d;
        v.push_back(d);
    }
    int b=v.size();
    sort(v.begin(), v.end());
    for(int i=1;i<a;i++){
        if(v[i]==v[i-1])
            b--;
    }
    cout<<b<<endl;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
col = []
for i, a in enumerate(A, start=1):
    col.extend([i] * a)

grid = []
for h in range(H):
    x = col[h * W: (h + 1) * W]
    if h % 2 == 0:
        x.reverse()
    grid.append(x)

for g in grid:
    print(*g)

Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define REP(i, n) for(ll i=0; i<(ll)(n); i++)
#define REPD(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=a; (ll)(b)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main(){
    ll n;   cin >> n;
    vector<ll> a(n);
    map<ll, ll> key;
    ll sum=0;
    REP(i, n){
        cin >> a[i];
        key[a[i]] += 1;
        sum += a[i];
    }
    ll q;   cin >> q;
    REP(i, q){
        ll from, to;    cin >> from >> to;
        ll num=key[from];
        sum -= num*from;
        sum += num*to;
        key[from] = 0;
        key[to] += num;
        cout << sum << endl;
    }
}


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

class Bmondai
{
    static void Main()
    {
        var N = Int32.Parse(Console.ReadLine()); 
        var H = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var ans = 1;
        //軸
        for (int i=1;i<N;i++)
        {
            var able = true;
            //回る
            for (int j=0;j<i;++j) if (H[i] - H[j] < 0) able = false;
            if (able) ans++;
        }
        Console.WriteLine(ans);
    }
}

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

int n, m, s, t;
int u[100010], v[100010], a[100010], b[100010];

const int MAX_N = 100010;
using TYPE = ll; // 距離の型を入れる
vector<pair<int, TYPE> > G[MAX_N];

vector<TYPE> dijkstra(int start){
	vector<TYPE> dist(MAX_N, 1e18);
	dist[start] = 0;//dist[i] :=　start->iまでの最短距離
	priority_queue<pair<TYPE, int>, vector<pair<TYPE, int> >, greater<pair<TYPE, int> > >  que;
	que.push(make_pair(0, start));
	while(!que.empty()){
		TYPE cost; int u;//今までにかかった時間 現在の頂点
		cost = que.top().first, u = que.top().second;
		que.pop();
		if(dist[u] < cost) continue;
		for (auto tmp : G[u]){
			int v = tmp.first; TYPE time = tmp.second;//隣接する頂点 その頂点まで行く時間
			if(dist[v] > dist[u] + time){//u->v
				dist[v] = dist[u] + time;
				que.push(make_pair(dist[v], v));
			}
		}
	}
	return dist;
}

int main(int argc, char const *argv[])
{
	cin >> n >> m >> s >> t; s--; t--;
	rep(i, m) cin >> u[i] >> v[i] >> a[i] >> b[i];
	rep(i, m) u[i]--, v[i]--;

	rep(i, m) G[u[i]].push_back(make_pair(v[i], a[i])), G[v[i]].push_back(make_pair(u[i], a[i]));

	auto dist = dijkstra(s);
	// rep(i, 4) printf("%lld ", dist[i]);
	// printf("\n");

	rep(i, MAX_N) G[i].clear();
	rep(i, m) G[u[i]].push_back(make_pair(v[i], b[i])), G[v[i]].push_back(make_pair(u[i], b[i]));

	auto rdist = dijkstra(t);
	// rep(i, 4) printf("%lld ", rdist[i]);
	// printf("\n");


	vector<ll> ans;
	ll min = 1e18;
	for (int i = n - 1; i >= 0; --i) {
		ll tmp = dist[i] + rdist[i];
		if (min > tmp) min = tmp;
		ans.push_back(min);
	}

	reverse(ans.begin(), ans.end());
	for (auto u : ans) printf("%lld\n", (ll)1e15 - u);
	return 0;
}



Measured memory_bytes: 14076
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define pi 3.14
using namespace std;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef pair<long long,int> pli;
typedef pair<int,long long> pil;
const int INF=1000000007;
const int MOD=1000000007;
const int nmax=401234;

ll a,b,c,tmp1,tmp2,flg;

int main()
{
    scanf("%lld%lld%lld",&a,&b,&c);
    tmp1=c-a-b;
    if(tmp1<0) flg=1;
    if(flg==0){
        tmp1=tmp1*tmp1;
        tmp2=4*a*b;
        if(tmp1<=tmp2) flg=1;
    }
    if(flg==1)
        puts("No");
    else
        puts("Yes");
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; i++)
#define repo(i, n) for(int i=1; i<=n; i++)
#define ssort(a) sort(a.begin(), a.end())
#define INF 1001001001
#define INFll 100100100100100
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;

using namespace std;
using ull = unsigned long long;
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

ll nlayer[55];
ll npaty[55];

ll paty(ll i, ll n){
  if(i==0)return 0;
  if(n==0)return 1;
  if(nlayer[n]/2+1==i){
    return 1+npaty[n-1];
  } else if(nlayer[n]/2+1>i){
    return paty(i-1, n-1);
  } else {
    return paty(i-(nlayer[n]/2+1), n-1)+1+npaty[n-1];
  }
}

int main(){
  int n;
  ll x;
  cin >> n >> x;
  
  nlayer[0]=1;
  npaty[0]=1;
  rep(i, n){
    nlayer[i+1]=2*nlayer[i]+3;
    npaty[i+1]=2*npaty[i]+1;
  }
  cout << paty(x, n) << endl;
  return 0;
}


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

using Weight=long long;

struct Edge{
    int to;
    Weight cap,rev;
    Weight cost;
};

using Edges=vector<Edge>;
using Graph=vector<Edges>;

class Flow{
    const Weight INF=1e9+7;
    int N;
    vector<int> level;
    vector<int> iter;
    void bfs(int s);
    Weight dfs(int v,int t,Weight f);
    public:
    Graph g;
    Flow(int N):N(N),g(N){};
    void addEdge(int from,int to,Weight cap);    
    Weight maxFlow(int s,int t);
};


void Flow::addEdge(int from,int to,Weight cap){
    g[from].push_back({to,cap,int(g[to].size()),0});
    g[to].push_back({from,Weight(0),int(g[from].size())-1,0});
}


Weight Flow::maxFlow(int s,int t){
    Weight flow=0;
    while(true){
        bfs(s);
        if(level[t]<0) return flow;
        iter.assign(N,0);
        Weight f;
        while((f=dfs(s,t,INF))>0){
            flow+=f;
        }
    }
}
void Flow::bfs(int s){
    level.assign(N,-1);
    queue<int> que;
    level[s]=0;
    que.push(s);
    while(!que.empty()){
        int v=que.front(); que.pop();
        for(int i=0;i<g[v].size();i++){
            Edge &e=g[v][i];
            if(e.cap>0 && level[e.to]<0){
                level[e.to]=level[v]+1;
                que.push(e.to);
            }
        }
    }
}

Weight Flow::dfs(int v,int t,Weight f){
    if(v==t) return f;
    for(int& i=iter[v];i<g[v].size();i++){
        Edge& e=g[v][i];
        if(e.cap>0 && level[v]<level[e.to]){
            Weight d=dfs(e.to,t,min(f,e.cap));
            if(d>0){
                e.cap-=d;
                g[e.to][e.rev].cap+=d;
                return d;
            }
        }
    }
    return 0;
}

int main(){
    int n,m;
    cin>>n>>m;
    Flow flow(n);
    map<pair<int,int>,int> edgemp;
    for(int i=0;i<m;i++){
        int a,b;
        cin>>a>>b;
        a--,b--;
        edgemp[{a,b}]=i+1;
        flow.addEdge(a,b,1);
        flow.addEdge(b,a,1);
    }
    int s,t;
    cin>>s>>t;
    s--,t--;
    int res=flow.maxFlow(s,t);
    set<int> revs;
    for(int i=0;i<n;i++){
        for(auto &e:flow.g[i]){
            if(e.cap==0){
                int a=e.to;
                int b=i;
                if(edgemp.count({a,b})){
                    revs.insert(edgemp[{a,b}]);
                }
            }
        }
    }
    cout<<res<<endl;
    cout<<revs.size()<<endl;
    for(auto &e:revs) cout<<e<<endl;
    return 0;
}


Measured memory_bytes: 3452
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define len(v) ll(v.size())
#define fi first
#define se second

template <class T>
void cout_vec(const vector<T> &vec){
  for(auto itr:vec) cout<<itr<<' ';
  cout<<'\n';
}

typedef pair<ll,ll> P;
const ll mod=1e9+7;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    vector<int> a(n),b(n);
    rep(i,n) cin>>a[i];
    rep(i,n) cin>>b[i];
    ll ans=0;
    rep(k,30){
      ll t=1<<k;
      ll cnt=0;
      vector<int> a2(n),b2(n);
      rep(i,n){
        a2[i]=a[i]%(2*t);
        b2[i]=b[i]%(2*t);
      }
      sort(begin(b2),end(b2));
      rep(i,n){
        cnt+=lower_bound(begin(b2),end(b2),2*t-a2[i])-lower_bound(begin(b2),end(b2),t-a2[i]);
        cnt+=lower_bound(begin(b2),end(b2),4*t-a2[i])-lower_bound(begin(b2),end(b2),3*t-a2[i]);
      }
      if(cnt%2==1) ans+=t;
    }
    cout<<ans<<endl;
}

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

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

int main(){
int A,B,C,X;
cin>>A>>B>>C>>X;
int ans=0;
rep(i,A){
  rep(j,B){
    rep(k,C){
int q=500*i+100*j+50*k;
if(q==X)
ans++;
    }
  }

}


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


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

int main(){
  int max = 0;
  int min = 0;
  int n = 0;
  int point = 0;
  int sum = 0;
  int summation = 0;

  while(true){
    sum = 0;
    int max = 0;
    int min = 0;
    cin >> n;
    if(n == 0) break;
    //int *s = new int[n];

    for(int i = 0; i < n; i++){
      cin >> point;
      if(i == 0){
        max = point;
        min = point;
      }else{
        if(point >= max) max = point;
        if(point <= min) min = point;
      }
      sum += point;
    }

    summation = sum - max - min;
    cout << summation / (n-2) << "\n";
  }
}



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

using namespace std;

bool fr[1000];

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

    int ans = 0;
    for (auto &c : s) {
        bool &x = fr[c - 'a'];
        if (x == 0) x = 1, ans++;
        else x = 0, ans--;
    }

    if (ans == 0) cout << "Yes\n";
    else cout << "No\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
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 MOD = 1000000007;

int main(void){
  int n; cin >> n;
  int l[n];
  rep(i,n) cin >> l[i];
  sort(l,l+n);
  int count = 0;
  for(int i = 0; i < n-2; i++){
    for(int j = i + 1; j < n-1; j++){
      for(int k = j + 1; k < n; k++){
        if(l[i] != l[j] && l[j] != l[k]){
          int a[3];
          a[0] = l[i];
          a[1] = l[j];
          a[2] = l[k];
          if(a[0] + a[1] > a[2]) count++;
        }
      }
    }
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3620