akhauriyash/Code-Regression huggingface dataset:
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

ways = [1, 1]
for i in range(2, n + 1):
    ways.append(ways[i-2] + ways[i-1])

stairs = []
now = 0
for i in range(m):
    stairs.append(a[i] - 1 - now)
    now = a[i] + 1

stairs.append(n - now)

ans = 1
for ele in stairs:
    if ele == -1:
        ans *= 0
    else:
        ans *= ways[ele]

mod = 10 ** 9 + 7
print(ans % mod)


Measured memory_bytes: 464928
#include<stdio.h>

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

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

    return 0;
}

Measured memory_bytes: 128
using System;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static void Main()
    {
        var num = int.Parse(Console.ReadLine());
        var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
        input.Sort((x, y) => y - x);
        var result = 0;

        for (int i = 0; i < input.Count; i++)
        {
            if (i % 2 == 0 || i == 0)
            {
                result += input[i];
            }
            else
            {
                result -= input[i];
            }
        }

        Console.WriteLine(result);
    }
}

Measured memory_bytes: 13268
// cout << "Case #" << test << ": ";
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;

int main() {
    double r;
    cin >> r;
    cout << fixed << setprecision(12) << 2 * r * 3.14159265 << endl;
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
#define low(i) (i&(-i))
#define mid ((l+r)>>1)
#define ls (now<<1)
#define rs (now<<1|1)
#define par pair<int,int>
#define mp make_pair
#define fr first 
#define se second
#define rep(i, x, y) for(int i=x; i<=y; ++i)
#define drep(i, x, y) for(int i=x; i>=y; --i)
#define fore(i, x) for(int i=fir[x]; i; i=nex[i])
char s[10];
bool check() 
{
    if (s[1] == s[2])
        return false;
    if (s[3] != s[4])
        return false;
    if (s[5] != s[6])
        return false;
    if (s[1] == s[3])
        return false;
    if (s[1] == s[5])
        return false;
    if (s[2] == s[3])
        return false;
    if (s[2] == s[5])
        return false;
    return true;
}
int main() 
{
    scanf("%s", s + 1);
    if (check())
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<set>
#include<vector>
#include<string>

using namespace std;

int N,cnt;
string S;


int main(){
    vector<string> ret;
    cin >> N;
    cin >> S;
    for(int i=0;i<1000;i++){
        int c[3]={i/100,(i/10)%10,i%10};
        int f=0;
        for(int j=0;j<N;j++){
            if(S[j]==('0'+c[f]))f++;
            if(f==3) break;
        }
        if(f==3)cnt++;
    }
    cout<<cnt<<endl;
}


Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define sort_i sort((i).begin(),(i).end())

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;

int main() {
	int h, w;
	cin >> h >> w;
	vs ans(h + 2);
	rep2(i, 0, w + 1) {
		ans[0] += "#";
		ans[h + 1] += "#";
		if (i == 0) {
			rep(j, 1, h + 1) {
				ans[j] += "#";
			}
		}
	}
	string s;
	rep(i, 1, h + 1) {
		cin >> s;
		ans[i] += s;
		ans[i] += "#";
	}
	rep(i, 0, ans.size()) {
		cout << ans[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 256
def peak():
    # 入力
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    A = list()
    B = list()
    for _ in range(M):
        dummy = list(map(int, input().split()))
        A.append(dummy[0])
        B.append(dummy[1])
    # 道がつながっている中で最大の展望台の高さを保存
    ovservatory_max_height = [0] * N
    for i in range(M):
        if H[B[i] - 1] > ovservatory_max_height[A[i] - 1]:
            ovservatory_max_height[A[i] - 1] = H[B[i] - 1]
        if H[A[i] - 1] > ovservatory_max_height[B[i] - 1]:
            ovservatory_max_height[B[i] - 1] = H[A[i] - 1]
    # つながっている展望台の最大長と比較
    is_good_list = list()
    for i in range(N):
        if H[i] > ovservatory_max_height[i] or ovservatory_max_height == 0:
            is_good_list.append(True)
        else:
            is_good_list.append(False)
    # 良い展望台の個数
    return is_good_list.count(True)    

result = peak()
print(result)

Measured memory_bytes: 23188
#include <bits/stdc++.h>
#define REP(i,n) for(int64_t i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REV(c) reverse((c).begin(),(c).end())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define COUTDOUBLE(d,i) cout << setprecision((i)) << (d) << endl;
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}
#define MREP(i,m) for(auto i=(m).begin(); i != (m).end(); ++i) // auto key = i->first;auto value = i->second;

using namespace std;
typedef int64_t I;
typedef pair<I,I> P;
typedef vector<I> V;

I MOD = pow(10,9)+7;
I MAX = LONG_MAX;
I MIN = LONG_MIN;

// 最大公約数
I gcd(I a, I b) {
  return b != 0 ? gcd(b, a % b) : a;
}

// 最小公倍数
I lcm(I a, I b) {
  return a * b / gcd(a, b);
}

int ctoi(char c){
  return c - '0';
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  I k;
  cin >> s >> k;
  I t=0, now=0;
  string ss;
  char c;
  if (k < pow(10,5)){
    REP(i,k){
      ss += s;
    }
    REP(i,ss.size()){
      if (c == ss.at(i)){
        now++;
      }else{
        t += now / 2;
        now = 0;
        now++;
      }
      c = ss.at(i);
    }
    t += now / 2;
    cout << t << endl;
    return 0;
  }else{
    I ch = 0;
    I diff = 0;
    bool chk=false;
    I diffE, diffO;
    REP(i,10){
      t = 0;
      now=0;
      ss += s;
      REP(j,ss.size()){
        if (c == ss.at(j)){
          now++;
        }else{
          t += now / 2;
          now = 0;
          now++;
        }
        c = ss.at(j);
      }
      t += now / 2;
      //cout << t << " " << ch << " " << diff << endl;
      if ((t - ch) == diff){
        chk = true;
        diff = t - ch;
        ch = t;
      }else{
        diff = t - ch;
        ch = t;
      }
      if (i==8){
        diffO = diff;
      }else if (i==9){
        diffE = diff;
      }
    }
    I an = t + (diffE + diffO) * ((k - 10)/2);
    if (k % 2 == 1){
      an += diffO;
    }
    cout << an << endl;
    return 0;
  }
  return 0;
}



Measured memory_bytes: 256
x, y, a, b, c = map( int, input().split() )
p = sorted( map( int, input().split() ), reverse=True)[:x]
q = sorted( map( int, input().split() ), reverse=True)[:y]
r = sorted( map( int, input().split() ), reverse=True)

total = sum((sorted(p+q+r, reverse=True)[:x+y]))
print( total )

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

typedef long long ll;

int main() {
	ll n;
	scanf("%lld", &n);
	for (ll i = 1; i < 8; i++) {
		if (pow(2, i) > n) {
			printf("%lld\n", (ll)pow(2, i - 1));
			return 0;
		}
	}

	return 0;
}


Measured memory_bytes: 2316
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<utility>
#include<map>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,m,n) for(ll i=m;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)
#define FORR(i,n,m) for(ll i=n-1;i>=m;i--)
#define all(in) in.begin(),in.end()
#define ALL(in,K) in,in+K
#define INF 100000000
#define MOD 100000007
#define SIZE 100005
#define pi 	3.14159265358979323846

int main(){
  double r;
  cin >> r;
  printf("%lf %lf\n",r*r*pi,r*2*pi);
  return 0;
}


Measured memory_bytes: 3192
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <math.h>
using namespace std;
#define ll long long int

int main(void)
{
	int a, b, d, g, count = 0;
	string l, m, n ;
	
	vector<int> vec(3);
	map<char, int> mp;
	string::iterator ai, ue;


	cin >> l;
	ai = l.begin();
	ue = l.end();
	ue--;
	for (;ai < ue;ai++, ue--)
	{
		if (*ai != *ue)
		{
			count++;
		}

	}	

		cout << count << endl;
	
	
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    int n;
    ll t,a,b;
    in>>n>>t;
    using P=pair<ll,ll>;
    vector<P> v;
    vector<ll> d(1,0);
    fr(i,n){
        in>>a>>b;++b;
        if(a) v.emplace_back(a,b);
        else d.emplace_back(b);
    }
    sort(v.begin(),v.end(),[](P x,P y){
        return x.second*y.first<y.second*x.first;
    });
    vector<ll> dp(32,INT_MAX);
    dp[0]=1;
    for(auto p:v){
        tie(a,b)=p;
        iFr(j,31){
            dp[j]=min(dp[j],dp[j-1]*(a+1)+b);
        }
    }
    sort(d.begin(),d.end());
    fr(i,d.size()-1) d[i+1]+=d[i];
    int ans{};
    fr(i,d.size()){
        if(d[i]>t+1) break;
        int x=upper_bound(dp.begin(),dp.end(),t-d[i]+1)-dp.begin()-1;
        ans=max(ans,x+i);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 6384
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
#define REP(i, a, n) for(int i=a; i<n; i++)

int q;
bool prime[100001];
int range[100001];
void make_prime() {
	REP(i, 2, 100001) prime[i] = true;
	
	for (int i = 2; i*i <= 100001; i++) {
		for (int j = i * 2; j < 100001; j += i) {
			prime[j] = false;
		}
	}
	return;
}
void range_2017prime() {
	REP(i, 2, 100001) {
		if (prime[i] && prime[(i + 1) / 2]) range[i]++;
		range[i] += range[i - 1];
	}
}
int main()
{
	cin >> q;

	make_prime();
	range_2017prime();

	REP(i, 0, q) {
		int l, r;
		cin >> l >> r;
		cout << range[r]-range[l-1] << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
#include<iostream>
#include<algorithm> 
#include<cstdio>
using namespace std;
int main()
{
    int n,ans,x;
    scanf("%d",&n);
	n=abs(n);
    while(x<n) 
	{
	    x+=++ans;
	} 
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static long mod =1000000007;
	public static void main(String[] args) {
			long a=sc.nextLong();
			long b=sc.nextLong();
			long c=sc.nextLong();
			long k=sc.nextLong();
			
			
			long ans=0;
			
			if(k%2==0) {
				ans=a-b;
			}else {
				ans=b-a;
			}
		p(ans);
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 21844
using System;

namespace PracticeForAtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            string[] str;

            n = int.Parse(Console.ReadLine());
            str = Console.ReadLine().Split(' ');
            int[] h = new int[n];
            int[] cost = new int[n];

            for(int i= 0; i < n; i++)
            {
                h[i] = int.Parse(str[i]);
            }

            cost[0] = 0;
            cost[1] = Math.Abs(h[1] - h[0]);

            for(int i = 2; i < n; i++)
            {
                cost[i] = cost[i-1] + Math.Abs(h[i] - h[i - 1]);
                if (cost[i - 2] + Math.Abs(h[i] - h[i - 2]) < cost[i])
                {
                    cost[i] = cost[i - 2] + Math.Abs(h[i] - h[i - 2]);
                }
            }

            Console.WriteLine(cost[n - 1]);
        }
    }
}


Measured memory_bytes: 16864
#include <iostream>

using namespace std;

int main() {
    bool card[4][13];
    
    for (int i = 0; i < 4; i++)
        for (int j = 0; j < 13; j++)
            card[i][j] = false;
    
    int n;
    cin >> n;
    
    for (int i = 0; i < n; i++) {
        char cardType;
        int x, y;
        cin >> cardType >> y;
        switch (cardType) {
            case 'S': x = 0; break;
            case 'H': x = 1; break;
            case 'C': x = 2; break;
            case 'D': x = 3; break;
        }
        card[x][y - 1] = true;
    }
    
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 13; j++) {
            if (!card[i][j]) {
                char cardType;
                switch (i) {
                    case 0: cardType = 'S'; break;
                    case 1: cardType = 'H'; break;
                    case 2: cardType = 'C'; break;
                    case 3: cardType = 'D'; break;
                }
                cout << cardType << " " << j + 1 << endl;
            }
        }
    }
    
    return 0;
}



Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
#define VECIN(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;

int main(){
	int n;
    cin>>n;
    vector<pair<pair<string,int>,int>> p(n);
    REP(i,n){
        int a;
        string s;
        cin>>s>>a;
        p[i]=make_pair(make_pair(s,-a),i+1);
    }
    sort(ALL(p));
    REP(i,n){
        OUT(p[i].second);
    }
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(V) V.begin(),V.end()
#define ll long long
#define MOD 1000000007

vector<string> gr(301);
int cut[300][300];

int main() {
	int H, W, K;
	cin >> H >> W >> K;
	for (int i = 0;i < H;i++) {
		cin >> gr[i];
	}

	int k = 0;bool str = 0;
	for (int i = 0;i < H;i++) {
		for (int j = 0;j < W;j++) {
			if (gr[i][j] == '#') {
				str = 1;
				k++;
				cut[i][j] = k;
			}
			else {
				if (str)cut[i][j] = k;
			}
		}
		str = 0;
	}

	for (int i = 0;i < H;i++) {
		for (int j = W - 1;j >= 0;j--) {
			if (cut[i][j] > 0)str = 1;
			else if (str) {
				cut[i][j] = cut[i][j + 1];
			}
		}
		str = 0;
	}

	for (int j = 0;j < W;j++) {
		for (int i = H - 1;i >= 0;i--) {
			if (cut[i][j] > 0)str = 1;
			else if (str) {
				cut[i][j] = cut[i + 1][j];
			}
		}
		str = 0;
	}

	for (int j = 0;j < W;j++) {
		for (int i = 0;i < H;i++) {
			if (cut[i][j] > 0)str = 1;
			else if (str) {
				cut[i][j] = cut[i - 1][j];
			}
		}
		str = 0;
	}

	for (int i = 0;i < H;i++) {
		for (int j = 0;j < W;j++) {
			cout << cut[i][j] << " ";
		}
		cout << endl;
	}
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
//cout << fixed << setprecision(10);

int main () {
  int n, m;
  cin >> n >> m;
  cout << (n == m ? "Yes" : "No") << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define FOR(i, k, n) for (int i = (k); i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.begin(), a.end(), greater<int>()
#define ROT(a) a.begin(), a.begin() + 1, a.end()
#define RROT(a) a.begin(), a.end() - 1, a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9 + 7;
const int MAX = 10000000;
template <typename T1, typename T2>
inline bool chmin(T1& a, T2 b)
{
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, T2 b)
{
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
T gcd(T a, T b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
//cout << 'H' << endl;
/*--------------------------------------------*/

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

    ll a, b, c, k;
    cin >> a >> b >> c >> k;


    cout << min(a, k) - max(k - (a + b), 0LL) << endl;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;
int main() {
	int N;
	cin >> N;
	if (N >= 1000) {
		cout << "ABD" << endl;
	}
	else {
		cout << "ABC" << endl;
	}
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    bool flag = false;
    while(n > 0) {
        if(n % 10 == 7) flag = true;
        n /= 10;
    }
    cout << ((flag) ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main()	
{
	int a,b;
	while(cin>>a>>b) 
	{
		int k;
		while(b--) cin>>k,a-=k;
		if(a<=0) cout<<"Yes\n";
		else cout<<"No\n";
	}
} 

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

int main()
{
	int n;
	cin >> n;
	int abc[3][100010];
	for (int i = 0; i < n; i++)
	{
		cin >> abc[0][i];
		cin >> abc[1][i];
		cin >> abc[2][i];
	}
	int dp[3][100010];
	dp[0][0] = abc[0][0];
	dp[1][0] = abc[1][0];
	dp[2][0] = abc[2][0];
	for (int i = 1; i < n; i++)
	{
		dp[0][i] = max(dp[1][i - 1], dp[2][i - 1]) + abc[0][i];
		dp[1][i] = max(dp[0][i - 1], dp[2][i - 1]) + abc[1][i];
		dp[2][i] = max(dp[0][i - 1], dp[1][i - 1]) + abc[2][i];
	}
	int x = max(dp[0][n - 1], max(dp[1][n - 1], dp[2][n - 1]));
	cout << x << endl;
}

Measured memory_bytes: 2560
using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.IO;
    using System.Text;

    class Program
    {
        static void Main()
        {
            string[] input = Console.ReadLine().Split(' ');
            var a = double.Parse(input[0]);
            var b = double.Parse(input[1]);
            var h = double.Parse(input[2]);
            var m = double.Parse(input[3]);
            var h_kakudo = 30 * h + (m / 60) * 30;
            var m_kakudo = 6 * m;
            var angleRAdianH = h_kakudo * Math.PI / 180; //度からラジアン角度を求める
            var angleRAdianM = m_kakudo * Math.PI / 180; //度からラジアン角度を求める

            var x1 = a * Math.Cos(angleRAdianH);
            var x2 = a * Math.Sin(angleRAdianH);
            var y1 = b * Math.Cos(angleRAdianM);
            var y2 = b * Math.Sin(angleRAdianM);

            var ans = Math.Sqrt((y2 - x2) * (y2 - x2) + (y1 - x1) * (y1 - x1));
            Console.WriteLine(ans.ToString());
        }
    }

Measured memory_bytes: 18680
#include <iostream>

int main()
{
    int a, b, c, d;
    std::cin >> a >> b >> c >> d;

    bool takahashi = true;

    while (0 < a && 0 < c)
    {
        if (takahashi)
        {
            c -= b;
        }
        else
        {
            a -= d;
        }

        takahashi = (takahashi ? false : true);
    }

    if (a <= 0)
    {
        std::cout << "No" << std::endl;
    }
    else
    {
        std::cout << "Yes" << std::endl;
    }

    return 0;
}


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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, pair<T1, T2> P)
{
    return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream &operator<<(ostream &s, vector<T> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        if (i > 0)
        {
            s << " ";
        }
        s << P[i];
    }
    return s;
}
template <class T>
ostream &operator<<(ostream &s, vector<vector<T>> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        s << endl
          << P[i];
    }
    return s << endl;
}
template <class T>
ostream &operator<<(ostream &s, set<T> P)
{
    EACH(it, P) { s << "<" << *it << "> "; }
    return s << endl;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, map<T1, T2> P)
{
    EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; }
    return s << endl;
}
template <class T>
void show(vector<T> v)
{
    for (int i = 0; i < v.size(); i++)
    {
        cerr << v[i] << " ";
    }
    cerr << "\n";
}
typedef long long ll;

signed main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    int minn = INF;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        chmin(minn, a[i]);
        sum += a[i];
    }
    if (n % 2 == 1)
    {
        if (sum % 2 == 0)
            cout << "Second" << endl;
        else
            cout << "First" << endl;
    }
    else
    {
        if (sum % 2 == 0)
        {
            if (minn % 2 == 1)
            {
                cout << "First" << endl;
            }
            else
            {
                cout << "Second" << endl;
            }
        }
        else
        {
            cout<<"First"<<endl;
        }
    }

    return 0;
}


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

int main(){
  ll n;
  cin >> n;
  vector<ll> a(100100, 0);
  rep(i, n){
    ll tmp;
    cin >> tmp;
    if(tmp)  
      a[tmp-1]++; 
    a[tmp]++, a[tmp+1]++;
  }
  cout << *max_element(a.begin(), a.end()) << endl;
}


Measured memory_bytes: 1024
/*
      author  : nishi5451
      created : 15.08.2020 14:12:44
*/

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


int main(){
    int n,k;
    cin >> n >> k;
    int ans = 0;
    while(n){
        n/=k;
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std;

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;
#define debug2(x,y) cerr << #x << " is " << x << " " << #y << " is " << y << endl;
#define debugg(g,h,w) rep(i,0,h) { rep(j,0,w) cout << g[i][j] << " "; cout << endl;}
#define debugv(v) for(auto&& x : v){cout << x << " ";} cout << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;
typedef pair<ll, ll> Pll;

int main()
{
	int n; cin >> n;
	int ans = 1;

	while (n > 3) {
		ans++;
		if (n % 3) {
			n = n/3 + 1;
		}
		else {
			n /= 3;
		}
		//debug2(ans,n);
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3084
#include <iostream>

using namespace std;

int s(int n)
{
    int s = 0;
    while (n > 0)
    {
        s += n % 10;
        n /= 10;
    }
    return s;
}


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

    cout << ((n % s(n) == 0) ? "Yes" : "No") << endl;
}


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

int main()
{
  i64 n;
  cin >> n;
  vector<i64> h(n);
  for (i64 i = 0; i < n; i++)
    cin >> h[i];
  for (i64 i = 1; i < n; i++)
  {
    if (h[i - 1] < h[i])
      h[i]--;
    if (h[i] < h[i - 1])
    {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 1152
def iin(): return int(input())
def nl(): return list(map(int, input().split()))
def ary(r, c, v): return [[v for _ in range(c)] for _ in range(r)]

x1, y1, x2, y2 = nl()
tx, ty = (-1) * (y2 - y1), (x2 - x1)
x3 = x2 + tx
y3 = y2 + ty

tx, ty = (-1) * (y3 - y2), (x3 - x2)
x4 = x3 + tx
y4 = y3 + ty

print(x3, y3, x4, y4)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

typedef long long int ll;

#define FOR(i,n,m) for(ll i=(ll)(m);i<(ll)(n);++i)
#define REP(i,n) FOR(i,n,0)
#define IREP(i,n) for(ll i=(ll)(n);i>=0;--i)

const ll MOD = 1000000007;

using namespace std;

int main()
{
	ll X, Y;
	cin >> X >> Y;

	int i = 0;
	while (X <= Y)
	{
		X *= (ll)2;
		i++;
	}

	cout << i << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

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

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		int input = Integer.parseInt(str);

		while(input != 0) {
			int count = 0;
			int sum;

			for(int i = 1; i <= input/2; i++) {
				sum = 0;
				for(int j = i; sum < input; j++)
					sum = sum + j;

				if(sum == input)
					count++;

			}
			System.out.println(count);
			str = br.readLine();
			input = Integer.parseInt(str);
		}



	}

}




Measured memory_bytes: 24432
#include<iostream>
using namespace std;
int gcd(int x,int y){
	if(x%y==0)
		return y;
	return gcd(y,x%y);
}
int main(){
	int a,b;
	while(cin>>a>>b){
		cout<<gcd(a,b)<<endl;
	}
	return 0;
} 


Measured memory_bytes: 3108
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"
#include "set"
#include "stack"
#include "tuple"

#define rep(n) for (int i = 0; i < n; ++i)
#define REP(n,i) for (int i = 0; i < n; ++i)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nyan "(=^･ω･^=)"
#define mkp make_pair
#define mkt make_tuple
#define P pair<ll, ll>
typedef long long ll;
using namespace std;

int n,k,a[100000],b[100000];
ll mx,cnt;

int main() {
	cin>>n>>k;
	mx=0;
	rep(n){
		cin>>a[i]>>b[i];
		if((k|a[i])==k)mx+=b[i];
	}
	rep(30){
		if((k%(1<<(i+1)))/(1<<i)%2){
			k=k-k%(1<<(i+1))+(1<<i)-1;
			cnt=0;
			REP(n,j)
				if((k|a[j])==k)cnt+=b[j];
//			cout<<cnt<<sp<<bitset<10>(k)<<endl;
			mx=max(mx,cnt);
		}
	}
	cout<<mx<<endl;
	return 0;
}


Measured memory_bytes: 1024
temparr = input()
from heapq import heappush, heappop

import sys
x=150000
sys.setrecursionlimit(x)
temparr = temparr.split()
n = int(temparr[0])
edg = int(temparr[1])
dicts = {}
secdict = {}
firstdict = {}
for e in range(edg):
    temparr = input()
    temparr = temparr.split()
    edgearr = []
    for i in temparr:
        edgearr.append(int(i))
    first = int(edgearr[0])
    sec = int(edgearr[1])
    if first not in dicts:
        dicts[first] = []
    dicts[first].append(sec)
    if first not in firstdict:
        firstdict[first] = 1 
tail = []
ans = {}

for i in range(1, n + 1):
    if i not in firstdict:
        tail.append(i)
        ans[i] = 0
        
def dfs(node):
    global ans, dicts
    if node in ans:
        return ans[node]
    if node not in  dicts:
        return 0  
    best = 0 
    for neigh in dicts[node]:
        curnew = dfs(neigh) + 1
        if curnew > best:
            best = curnew
    ans[node] = best 
    return best
ans2 = 0 
for i in range(1, n + 1):
    ans2 = max(dfs(i), ans2)
print(ans2)


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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 100005

int n , q , l , r;
string s;
int p[MAXX];

int main()
{
    _FastIO;
    cin >> n >> q;
    cin >> s;
    for(int i = 1; i < n; i++){
        p[i + 1] = p[i];
        if(s[i - 1] == 'A' && s[i] == 'C')
            p[i + 1]++;
    }
    while(q--){
        cin >> l >> r;
        cout << (p[r] - p[l]) << endl;
    }
    return 0;
}


Measured memory_bytes: 1488
#!/usr/bin/env python

def maxArea(a, b):
    return a * b / 2

def isMultiple(a, b, x, y):
    return 1 if 2 * x == a and 2 * y == b else 0

def main():
    a, b, x, y = list(map(int, input().split()))
    print("{0} {1}".format(maxArea(a, b), isMultiple(a, b, x, y)))

if __name__ == '__main__':
    main()

Measured memory_bytes: 38384
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <functional>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

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

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

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

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

    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    int ans = 0;
    rep(i, n) rep(j, n){
        if(i == j) continue;
        ans += a[i] * a[j];
    }
    cout << ans / 2 << endl;

    return 0;
}


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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

main(){
    string s;
    cin >> s;
    if (s=="Sunny") cout << "Cloudy" << endl;
    else if (s=="Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cassert>
#include <string>
#include <iostream>

using namespace std;
typedef long long ll;

int p[1000100];

int main(){
    int N;
    cin >> N;
    for(int i=0; i < N; i++){
        int a = 0;
        cin >> a;
        p[a - 1] = i;
    }
    int ans=1;
    int t = 1;
    for(int i=1; i < N; i++){
        if(p[i] > p[i-1])t++;
        else t = 1;
        ans = max(ans , t);
    }

    cout << N - ans << endl;
    
    
}


Measured memory_bytes: 1024
#include <stdio.h>

main() {
    
        int n;
  
        scanf("%d\n", &n);
        
        for(int i=1;i<=n;i++){
            int k,p;
            scanf("%d %d\n",&k,&p);
            
            if(k>=p){
                if(k%p==0){
                    printf("%d\n",p);
                }else{
                    printf("%d\n",k%p);
                }
            }else{
                printf("%d\n",k);
            }
        }

  return 0;
}


Measured memory_bytes: 2104
fun main() {
    var nm=readLine()!!.split(" ").map { it.toInt() }.toIntArray()
    var ks:MutableList<List<Int>> = List(nm[1]){ List(0){0} }.toMutableList()
    for (i in 0 until nm[1]){
        ks[i]= readLine()!!.split(" ").map { it.toInt() }
    }
    var p= readLine()!!.split(" ").map { it.toInt() }

    var ans=0
    for (i in 0 until Math.pow(2.toDouble(), nm[0].toDouble()).toInt()){
        var tmp1=true
        for (j in 0 until nm[1]){
            var tmp2=0
            for (k in 1 .. ks[j][0]){
                if(i.shr(ks[j][k]-1)%2==1) tmp2++
            }
            if (tmp2%2!=p[j]) tmp1=false
        }
        if (tmp1) ans++
    }
    println(ans)
}

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

using namespace std;

int main() {
    int a, b, x;
    cin >> a >> b >> x;
    
    if (a <= x and x <= a + b) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


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

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << "\n";
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int n;
    cin >> n;

    ll ans = 0;
    FOR(a, 1, n) {
        int b_max = n / a;

        if (n % a == 0) b_max--;

        ans += b_max;
    }

    print(ans);
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(c) (c).begin(), (c).end()
#define pb push_back
#define eb emplace_back
const long long INF = 1LL<<60; // 仮想的な無限大の値;
using namespace std;
using ll = long long;
using P  = pair<int, int>;
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; }
using Graph = vector<vector<int>>;
int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(N+5);
    vector<int> B(N+5);
    Graph G(N);
    rep(i, M)
    {
        int a, b;
        cin >> a >> b;
        --a;--b;
        G[a].pb(b);
        G[b].pb(a);
        // --A[i];
        // --B[i];
        // G[A[i]].pb(B[i]);
        // G[B[i]].pb(A[i]);
    } 
    rep(i, N)
    {
        std::sort(G[i].begin(), G[i].end());
        G[i].erase(std::unique(G[i].begin(), G[i].end()), G[i].end());
    }

// int i = 0;
//     {
//          for(auto itr =  G[i].begin(); itr !=  G[i].end(); ++itr)
//          {
//              cout << *itr << " ";
//          }
//          cout << endl;
//     }
    //return 0;


    //  // グラフ入力受取
    // Graph G(N);
    // for (int i = 0; i < M; ++i) {
    //     G[A[i]].push_back(B[i]);
    //     G[B[i]].push_back(A[i]);
    // }

// 頂点 s をスタートとした探索
#if 1
    // 頂点 s をスタートとした探索
    int ans = 0;
    int ax = 0;
    vector<int> dist(N, -1);
    queue<int> que;
    int count = 0;
    for (int v = 0; v < N; ++v) {
        ax = 1;
        if (dist[v] != -1) continue; // v が探索済みならスルー
        dist[v] = 0, que.push(v);
        while (!que.empty()) {
            int v = que.front(); que.pop();
            //for (auto nv : G[v]) 
            if(!G[v].empty())
            {
                for(auto itr =  G[v].begin(); itr !=  G[v].end(); ++itr)
                {
                    int nv = *itr;
                   // cout << nv << "," << v << endl;

                    if (dist[nv] == -1) {
                        dist[nv] = dist[v] + 1;
                        que.push(nv);
                        ++ax;
                    }
                }
            }
        }
        chmax(ans, ax);
        ++count;
    }
    cout << ans << endl;
#endif
    return 0;
}

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

int main()
{
    vector<int> fac(10000001, 1);
    for (int i = 2; i < 10000001; i++)
    {
        for (int j = 1; i * j < 10000001; j++)
        {
            fac[i * j] += 1;
        }
    }
    ll ans = 0;
    int n;
    cin >> n;
    for (ll i = 1; i <= n; i++)
        ans += i * fac[i];
    cout << ans << endl;
}

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

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'

// n回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;  // 2次元配列
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> PII;

template<typename T>
using vec = vector<T>;
template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

const ld Pi = std::acos(-1.0L);
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;


/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
    // cout << fixed << setprecision(15);

    int n; cin >> n;
    vi a(n+2);
    a[0] = a[n+1] = 0;
    rep1(i,n) cin >> a[i];
    ll total = 0;
    rep(i,n+1) total += abs(a[i] - a[i+1]);

    ll tmp;
    rep1(i,n) {
        tmp = total - abs(a[i-1] - a[i]) - abs(a[i] - a[i+1]) + abs(a[i-1] - a[i+1]);
        cout << tmp << '\n';
    }

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}

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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >
signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);

    int n, m;
    cin >> n;
    vector<string> s(n);
    init(s);
    cin >> m;
    vector<string> t(m);
    init(t);

    map<string, int> mp;
    for (auto& e : s) mp[e]++;

    for (auto& e : t) mp[e]--;

    int maval = 0;
    for (auto& e : mp) chmax(maval, e.second);

    print(maval);

    return 0;
}


Measured memory_bytes: 256
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
count = 0
for i in range(n):
    ai = list(map(int, input().split()))
    num = 0
    for j in range(len(ai)):
        num += ai[j] * b[j]
    if num + c >0:
        count += 1
print(count)


Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#include<complex>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	double l, r;
	int al, ar, bl, br, cl, cr, dl, dr;
	al = ar = bl = br = cl = cr = dl = dr = 0;
	while (cin >> l >> r) {
		if (l >= 1.1)al++;
		else if (l >= 0.6)bl++;
		else if (l >= 0.2)cl++;
		else dl++;
		if (r >= 1.1)ar++;
		else if (r >= 0.6)br++;
		else if (r >= 0.2)cr++;
		else dr++;
	}
	cout << al << " " << ar << endl;
	cout << bl << " " << br << endl;
	cout << cl << " " << cr << endl;
	cout << dl << " " << dr << endl;
	return 0;
}

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

namespace ABC153D
{
    class Program
    {
        static void Main(string[] args)
        {
            long H = long.Parse(Console.ReadLine());

            long ans = C(H);



            Console.WriteLine(ans);
            Console.ReadKey();
        }

        static long C(long health)
        {
            if (health == 1) return 1;
            else return 1 + 2 * C(health / 2);
        }

        static int[] ReadInt()
        {
            int[] ret = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return ret;
        }
        static long[] ReadLong()
        {
            long[] ret = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return ret;
        }
    }
}


Measured memory_bytes: 13140