akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;

#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define mp make_pair

int main(){
    vvi G;
    string s;
    while(cin>>s){
        replace(all(s), ',', ' ');
        vi v;
        stringstream ss(s);
        int i=0;
        while(ss>>i) v.push_back(i);
        G.push_back(v);
    }

    rep(i,G.size()-1){
        vi & next=G[i+1];
        vi & cur=G[i];

        if(next.size() > cur.size()){
            rep(j,next.size()){
                if(j==0) next[j] += cur[j];
                else if(j==next.size()-1) next[j] += cur[j-1];
                else next[j] += max(cur[j], cur[j-1]);
            }
        } else {
            rep(j,next.size()){
                next[j] += max(cur[j], cur[j+1]);
            }
        }
    }
    cout << G.back().back() << endl;
}

Measured memory_bytes: 1260
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
//#pragma GCC target ("avx,avx2,tune=native")
//#pragma GCC optimization ("unroll-loops")
#include "bits/stdc++.h"

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/rope>

using namespace __gnu_pbds; 
using namespace __gnu_cxx;
using namespace std;
using ll = long long;

#define eb emplace_back
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(v) ((int)v.size())
#define all(v) v.begin(), v.end()
#define precision(n) fixed<<setprecision(n)

#ifdef LOCAL
    #include "debug.h"
#else
    #define debug(...) 42
#endif

void io(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);    
    #ifdef LOCAL
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
        freopen("output.txt","w",stderr);
    #endif
}
template<typename T> using oset = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update >;
template<typename T> using MinPriorityQueue = priority_queue <T, vector <T>, greater <T> >;
template<typename T> void done(T ans) {cout << ans << "\n"; exit(0);}

auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937_64 mt(seed);

clock_t time_p=clock();
void printTime(){
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

template <typename A>
istream& operator>>(istream& input,vector<A>& x) {
  for(auto& i:x)
    input>>i;
  return input;
}
 
template<typename A>
ostream& operator<<(ostream& output,vector<A>& x) {
  for(auto& i:x)
    output<<i<<' ';
  return output;
}


const int N = 2e5 + 5;
const int mod = 1e9 + 7;

int main() {
    io();
    int n;
    cin >> n;
    n = n * 2;
    string s;
    cin >> s;
    int arr[n];
    for(int i = 0; i < n; i++) {
        if(s[i] == 'W')
            arr[i] = 0 ;
        else
            arr[i] = 1 ;
    }
    long long ans = 1ll ;
    long long moves = 0 ;
    if(arr[0] == 0)
        return cout << 0 << "\n", 0;

    for(int i = 0 ; i < n; ++i) {
        if((arr[i] + moves) % 2 != 0)
            moves++ ;
        else {
            ans = (ans * moves) % mod ;
            ans %= mod ;
            moves-- ;
        }
        if(moves > n / 2 || moves < 0)
            return cout << 0 << "\n" , 0 ;
    }
    if(moves != 0)
        return cout << 0 << "\n" , 0 ;
    long long fact = 1ll ;
    for(int i = 2 ; i <= n / 2 ; ++i) {
        fact = (fact * i) % mod ;
        fact %= mod ;
    }
    ans = (ans * fact) % mod ;
    ans %= mod ;
    return cout << ans << "\n" , 0;
}



        

Measured memory_bytes: 1360
// #include <iostream>
// #include <string>
// #include <math.h>
// #include <map>
// #include <vector>
// #include <tuple>
// #include <algorithm>
// #include <queue>
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define vi vector<int>
#define vlli vector<lli>
#define pii pair<int, int>
#define plli pair <lli, lli>
#define F(i,n) for(lli (i)=0;(i)<(n);(i)++)
#define FR(i,n) for(lli (i)=(n)-1;(i)>=0;(i)--)
#define FSG(i,a,b) for(lli (i)=(a);(i)<(b);(i)++)
#define FSGR(i,a,b) for(lli (i)=(b)-1;(i)>=(a);(i)--)
#define VAL(n) cout << n << endl;
#define VALD(n) cout << #n << ": " << n << endl;
int main(){
  int N;
  cin >> N;
  cout << double(N / 2 + N % 2) / double(N) << endl;
  return 0;
}


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

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

    int cnt = 0;
    while (n != 0) {
        n /= k;
        cnt++;
    }
    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
n = S()
if n == n[::-1]:
    print("Yes")
else:
    print("No")
#B

#C
"""
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
n = I()
a = IR(n)
l = a[0]
for i in range(1,n):
    g = gcd(l,a[i])
    l *= a[i]//g
print(l)
"""

#D
"""
n = I()
v = [[] for i in range(n)]
for i in range(n-1):
    a,b,c = LI()
    a -= 1
    b -= 1
    v[a].append([b,c])
    v[b].append([a,c])
Q,k = LI()
d = [-1 for i in range(n)]
d[k-1] = 0
q = deque()
q.append(k-1)
while q:
    x = q.pop()
    for y,c in v[x]:
        if d[y] == -1:
            d[y] = d[x]+c
            q.append(y)
for i in range(Q):
    x,y = LI()
    x -= 1
    y -= 1
    print(d[x]+d[y])
"""


#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 39152
#include<cstdio>
#define N 3005
#define ld double
int n;
ld p[N],dp[N][N];
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;++i)scanf("%lf",&p[i]);
	dp[0][0]=1;
	for(int i=0;i<n;++i)for(int j=0;j<=n;++j){
		dp[i+1][j]+=dp[i][j]*(1-p[i]);
		if(j+1<=n)dp[i+1][j+1]+=dp[i][j]*p[i];
	}
	ld ans=0;
	for(int i=0;i<=n;++i)if(i>=n-i)ans+=dp[n][i];
	printf("%.10f\n",ans);
	return 0;
}

Measured memory_bytes: 70656
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

from heapq import heappop, heappush
def dijkstra(E,s,n,inf=float('inf')):
    d = [inf]*n
    d[s] = 0
    q = []
    heappush(q,(0,s))
    while q:
        du,u = heappop(q)
        if d[u] < du:
            continue
        for v,dist in E[u]:
            dnew = du + dist
            if d[v] > dnew:
                d[v] = dnew
                heappush(q,(dnew,v))
    return d

N = I()
a,b,c = LIR(N-1,3)
Q,K = LI()
x,y = LIR(Q,2)

E = [[] for _ in range(N)]
for i in range(N-1):
    E[a[i]-1].append((b[i]-1,c[i]))
    E[b[i]-1].append((a[i]-1,c[i]))

d = dijkstra(E,K-1,N,inf=10**9*(N-1)+1)

for i in range(Q):
    print(d[x[i]-1]+d[y[i]-1])

Measured memory_bytes: 115420
#pragma region template 1.0
#pragma region def
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> ii;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP1(i, n) for (ll i = 1; i <= (n); ++i)
#define OUT(x) cout << (x) << endl;
#define OUTA(a) \
    REP(i, (a).size()) { cout << (a[i]) << (i == (a).size() - 1 ? "\n" : " "); }
#define ALL(a) (a).begin(), (a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) \
    SORT(a);     \
    reverse(ALL(a))

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#pragma endregion enddef

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

    if (S <= "2019/04/30")
    {
        OUT("Heisei");
    }
    else
    {
        OUT("TBD");
    }
}
#pragma endregion template

Measured memory_bytes: 256
// abc123_a
#include "iostream"
using namespace std;

int main(int argc, char *argv[])
{
  int a[5],k;
  for(int i=0;i<5;i++) cin >> a[i];
  cin >> k;

  if(a[4]-a[0]>k) cout << ":(" << endl;
  else cout << "Yay!" << endl;

  return 0;
}


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

int main(){
  long long N;
  cin >> N;
  map<long long, long long> A;
  for(long long i=1; i<N+1; i++){
    long long x;
    cin >> x;
    A.emplace(x, i);
  }
  for(long long i=1; i<N+1; i++){
    cout << A.at(i)<<" ";
  }
  cout << endl;
  return 0;
}

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


int main()
{

	int n, maxGram;

	cin >> n >> maxGram;

	long minmum = 100001;
	for (int i = 0; i < n; i++) {
		int m;
		cin >> m;
		maxGram -= m;
		if (m < minmum) {
			minmum = m;
		}
	}

	int result = maxGram / minmum + n;

	cout << result << endl;

	
	int quit; cin >> quit;
	return 0;
}






Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define deba(a) for(ll i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<endl;
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void solve(){
    ll n;
    cin>>n;
    vector<vector<ll>>v(n,vector<ll>(3));
    fr(i,0,n){
    fr(j,0,3)
        cin>>v[i][j];
        
    }
    ll ans[n][3];
    memset(ans,0,sizeof(ans));
   fr(i,0,3)
       ans[0][i]=v[0][i];
    fr(i,1,n){
        fr(j,0,3){
            fr(k,0,3){
                if(j!=k)
                ans[i][j]=max(ans[i][j],ans[i-1][k]+v[i][j]);
            }
        //    cout<<ans[i][j]<<" ";
        }
       // cout<<endl;
    }
    cout<<max(ans[n-1][0],max(ans[n-1][1],ans[n-1][2]));
    
    
}  
int main(){
    ll t=1;
//cin>>t;
while(t--){
     solve();
   //  cout<<endl;
}
    return 0;
}

Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REPS(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
using ll = long long;
using ld = long double;

int main(void) {
    int A, B;
    cin >> A >> B;

    int ans = -1;
    bool ng = true;
    REPS (i, 1009) {
        int x = i*0.08;
        int y = i*0.1;
        if (A == x && B == y) {
            ans = i;
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int a, d, e;
  char b[51]={}, c;
  scanf("%d %d ", &a, &d);
  for(int i=1; i<=a; i++)
    scanf("%c", &c), b[i]=c;
 for(int i=1; i<=a; i++)
 {
   if(i==d) printf("%c", b[i]-'A'+'a');
     else printf("%c", b[i]);
	}
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
	char ch = ' ';
	for (; ch < '0' || ch > '9'; ch = getchar());
	for (; ch >= '0' && ch <= '9'; ch = getchar())
		if (ch == 57){
			puts("Yes");
			return 0;
		}
	puts("No");
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
   int i,w,s,k=0;
   while(1){
       scanf("%d",&w);
       if(w==-1)break;
       for(i=11,k=1150;i<=w;i++){
           if(i<=20)k+=125;
           else if(i<=30) k+=140;
           else k+=160;
       }
       printf("%d\n",4280-k);
   }
   return(0);
}



Measured memory_bytes: 2044
#include <bits/stdc++.h>
#define rep(i, n) for (rint i = 1; i <= (int)(n); i ++)
#define re0(i, n) for (rint i = 0; i < (int) n; i ++)
#define travel(i, u) for (rint i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;

typedef long long lo;

template<typename tp> inline void read(tp &x) {
    x = 0; char c = getchar(); int f = 0;
    for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
    for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
    if (f) x = -x;
}
namespace {
    const int mo = 998244353;
    inline int add(int x, int y) { x += y; return x >= mo ? x - mo : x; }
    inline int sub(int x, int y) { x -= y; return x < 0 ? x + mo : x; }
    inline int mul(int x, int y) { return (lo) x * y % mo; }
    inline int power(int a, int k = mo - 2) {
		int ans = 1;
		for (; k; k >>= 1, a = mul(a, a))
			if (k & 1) ans = mul(ans, a);
		return ans;
    }
	inline void U(int &x, int y) { x = add(x, y); } 
}
const int N = 3e5 + 233;
int n, len, ans = 1;
char str[N];

int main(void) {
	read(n); len = 3 * n;
	scanf("%s", str + 1);
	rep (i, len) str[i] = str[i] == 'R' ? 1 : str[i] == 'B' ? 2 : 4;
	map <int, int> mp;
	rep (i, len) {
		int to = 7 - str[i];
		if (mp.count(to)) {
			ans = mul(ans, mp[to]);
			if (!--mp[to]) mp.erase(to);
		} else {
			int c = -1;
			for (auto i : mp)
				if (__builtin_popcount(i.first) == 1) c = i.first;
			// cout << i << " " << c << "\n";
			if (c != -1 && c != str[i]) {
				ans = mul(ans, mp[c]);
				if (!--mp[c]) mp.erase(c);
				mp[c + str[i]]++;
			} else {
				mp[str[i]]++;
			}
		}
	}	
	rep (i, n) ans = mul(ans, i);
	cout << ans << "\n";
}


Measured memory_bytes: 512
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <string>
#include <algorithm>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;

#define LSOne(S) (S & (-S))
#define isBitSet(S, i) ((S >> i) & 1)
using namespace std;

int main()
{
string s;
cin>>s;
ll  sum=0;
for(int i=0;i<s.size();++i){
    sum+=(s[i]-'0');
}
if(sum%9==0) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3720
import collections
N=int(input())
L=list(map(int,input().split()))
ans=0
for i in range(N):
    for j in range(i+1,N):
        for h in range(j+1,N):
            A=L[i]
            B=L[j]
            C=L[h]
            if abs(A-B)<C<A+B and A!=B and B!=C and C!=A:
                ans+=1
print(ans)

Measured memory_bytes: 9452
fun main(arg: Array<String>) {
    val N = nextInt()
    val A = listOfInt().sorted()
    var (p, q) = 
        if (N % 2 != 0) { if (A[0] != 0) return println(0)
             1 to 2 } 
        else 0 to 1
    var ans = 1L
    while (p < N) {
        if (A[p] != q || A[p + 1] != q) return println(0)
        ans = ans * 2 % 1000000007
        p += 2
        q += 2
    }
    println(ans)
}

fun next() = readLine()!!
fun nextInt(offset: Int = 0) = Integer.parseInt(next()) + offset
fun nextLong() = next().toLong()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
fun listOfInt(offset: Int = 0) = listOfString().map { Integer.parseInt(it) + offset }
fun listOfLong() = listOfString().map(String::toLong)
fun tripleIntIntLong() = listOfLong().let { Triple(it[0].toInt(), it[1].toInt(), it[2]) }
fun listOfInt(vararg offset: Int) = listOfString().map { Integer.parseInt(it) }.mapIndexed { index, int -> int + offset[index % offset.size] }


Measured memory_bytes: 54092
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <stack>
#include <climits>

using namespace std;

typedef vector< vector< int > > matrix;
int N,K;


int solve(matrix &A){
	matrix DP(N+1, vector<int>(3));
	
	DP[0][0] = 0;
	DP[0][1] = 0;
	DP[0][2] = 0;
	
	for(int i=1; i <= N; i++){
		for(int k=0; k < 3 ; k++){
			switch(k){
				case 0: DP[i][0] = max(DP[i-1][1],DP[i-1][2]) + A[i-1][0]; break;
				case 1: DP[i][1] = max(DP[i-1][0],DP[i-1][2]) + A[i-1][1]; break;
				case 2: DP[i][2] = max(DP[i-1][0],DP[i-1][1]) + A[i-1][2]; break;
			}
		}
	}
	
	
	
	return max( DP[N][0], max(DP[N][1] , DP[N][2]) );
}


int main(int argc, char** argv) {
	cin >> N;
	
	matrix A(N , vector<int> (3) );
	
	for(int i=0;i< N;i++){
		int p,e,d;
		cin >> p >> e >> d;
		A[i][0] = p;
		A[i][1] = e;
		A[i][2] = d;
	}
	
	cout << solve(A);	
	return 0;
}

Measured memory_bytes: 11136
#include "bits/stdc++.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define repr(i,a,n) for(ll i = n-1;i >= a;i--)
#define LINF (ll)1e17
#define INF 1e9
#define MOD (ll)1e9+7
#define sMOD 1e5
#define fs first
#define sc second
#define setprecision(d) cout << fixed << setprecision(d);

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
	
}

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


signed main(){

	ll n,a,b;
	cin >> n >> a >> b;

	if((a+b) % 2 == 0) cout << abs(a-(a+b)/2) << endl;
	else if(b-a == 1) cout << min(max(a-1,b-1),max(n-b,n-a)) << endl;
	else cout << min(a + (b-a+1)/2 - 1,(n-b+1) +  (n + (a+n-b+1))/2  - (a+n-b+1)) << endl;

    return 0;
}

Measured memory_bytes: 256
#define rep(i,n) REP(i,0,n)
#define REP(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

long long DIV = (long long)1e9+7;
long long P3[(long long)1e5+100];
long long P2[(long long)1e5+100];

long long GetP3(long long l) {
   if(!P3[l]) P3[l] = (GetP3(l-1)*3)%DIV;
   return P3[l];
}

long long GetP2(long long l) {
   if(!P2[l]) P2[l] =  (GetP2(l-1)*2)%DIV;
   return P2[l];
}

int main(void) {
   string s;
   cin>>s;
   int N = s.size();
   int L[N];
   rep(i,N) {
      if (s[N-i-1] == '0') L[i] = 0;
      else L[i] = 1;
   }
   rep(i,(long long) 1e5+100) P2[i] = 0;
   rep(i,(long long) 1e5+100) P3[i] = 0;

   P3[0] = 1;
   P2[0] = 1;
   ll ans = 0;
   ll m = 0;
   for (int i = N-1;i >=0;i--) {
      if (!L[i]) continue;
      ans += (GetP3(i) * GetP2(m))%DIV;
      // ans += pow(3,i) * pow(2,m);
      m++;
   }
   ans += GetP2(m);
   ans = ans%DIV;
   cout<<ans<<endl;




   return 0;
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
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; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	
	int n,k; cin >> n >> k;
	
	vector<int> a(n),b(n); rep(i,n) cin >> a[i] >> b[i];
	
	using pll=pair<ll,ll>;
	
	vector<pll> p(n);
	rep(i,n) p[i]=pll(a[i],b[i]);
	sort(all(p));
	
	ll sum=0;
	int c;
	
	rep(i,n){
		rep(j,p[i].second){
			sum+=p[i].first;
			c++;
			
			//cout << c << sum << endl;
			
			if(c==k) {
				i=n;
				j=p[i].second;
			}
		}
	}
	
	
	
	
	
	cout << sum << endl;

	
	return 0;
}



Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

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

  int n, m;
  cin >> n >> m;
  vector<int> p(m);
  vector<string> s(m);
  for (int i = 0; i < m; i++) {
    cin >> p[i] >> s[i];
  }

  set<int> ac;
  map<int, int> mp;
  for (int i = 0; i < m; i++) {
    string si = s[i];
    if (si == "AC") {
      ac.insert(p[i]);
    } else {
      if (ac.find(p[i]) == ac.end()) {
        mp[p[i]]++;
      }
    }
  }

  // acしなければペナルティにならない
  int penaCnt = 0;
  for (auto num : ac) {
    // num = acした問題の番号
    penaCnt += mp[num];
  }

  int acCnt = ac.size();

  cout << acCnt << " " << penaCnt << endl;

  return 0;
}

Measured memory_bytes: 15488
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		// fmt.Println(err)
	}
	return a
}

func scanInt3() (int, int, int) {
	return scanInt(), scanInt(), scanInt()
}

func main() {
	sc.Split(bufio.ScanWords)

	N := scanInt()
	var ans int

	max := 0

	for i := 0; i < N; i++ {
		tmp := scanInt()

		if max <= tmp {
			ans += 0
			max = tmp
		} else {
			step := max - tmp
			ans += step
			max = step + tmp
		}
	}

	fmt.Println(ans)
}


Measured memory_bytes: 5028
N=int(input()) 
A=int(input()) 
B=int(input()) 
C=int(input()) 
D=int(input()) 
E=int(input())

x = [A,B,C,D,E] 
pace = min(x) 
y = int(N/pace)
if pace == 1:
    print(y+4)
else:
    print(y+5)

Measured memory_bytes: 3064
n,a,b=map(int,input().split())
s=input()
j=0#japan
f=0#foreign
for i in s:
    if i=='a':
        if j+f<a+b:
            j+=1
            print('Yes')
        else:
            print('No')
    elif i=='b':
        if j+f<a+b and f<b:
            f+=1
            print('Yes')
        else:
            print('No')
    else:
        print('No')

Measured memory_bytes: 4016
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: str):
    return S.count('ABC')


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    print(f'{solve(N, S)}')


if __name__ == '__main__':
    main()


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

#define ll long long

template<typename T> void drop(const T &x){cout<<x<<'\n';exit(0);}

void solve() {
  int k, x; cin >> k >> x;
  cout << (500*k >= x ? "Yes" : "No") << '\n';
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T=1;
  //cin >> T;
  while(T--) solve();

  return 0;
}


Measured memory_bytes: 3648
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    string s; cin>>s;
    map<char, int> mp;
    for(int i=0; i<4; i++) mp[s[i]]++;
    if(mp.size()==2 && (*mp.begin()).second==2) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
/**
 *      purpose : 
 *      author  : kyomukyomupurin
 *      created : 
**/

// input/output
#include <iostream>
#include <fstream>
#include <sstream>
// container class
#include <array>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// math, algorithm
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
// etc
#include <bitset>
#include <cctype>
#include <cstring>
#include <chrono>
#include <iomanip>
#include <random>
#include <utility>
// using-directive
using namespace std;
// alias template
using int64 = int64_t;
using pii = pair<int, int>;
using pll = pair<int64_t, int64_t>;
// text macro replacement
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define print(x) cout << (x) << '\n'
#define debug(x) cout << #x << ": " << (x) << '\n'

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

  int n, m; cin >> n >> m;
  int pos = m / n;
  while (1){
    if (m % pos == 0){
      print(pos); return 0;
    }
    else --pos;
  }

  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

static char grade(int m, int f, int r) {
  if (m == -1 || f == -1)
    return 'F';

  const int s = m + f;
  if (s >= 80)
    return 'A';
  else if (65 <= s && s < 80)
    return 'B';
  else if (50 <= s && s < 65)
    return 'C';                                                                      
  else if (30 <= s && s < 50)
    return r >= 50 ? 'C' : 'D';                                                      

  // s < 30                                                                                                                                                               
  return 'F';
}

int main() {
  int m, f, r;
  for (;;) {
    cin >> m >> f >> r;
    if (m == -1 && f == -1 && r == -1)
      break;
    cout << grade(m, f, r) << endl;
  }
  return 0;
}

Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORD(i, a, b) for (ll i = a ; i > b ; i--)
#define hahashad ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
typedef long long ll;
#define VL vector<ll> 
#define what(A) cout<<#A<<" is "<<A<<endl;
int main()
{
    ll n,WA=0,AC=0,RE=0,TLE=0;
    cin>>n;
    string s[n];
    FOR(i,0,n)
    {
        cin>>s[i];
    	if(s[i]=="AC")
        {
            AC++;
        }
        if(s[i]=="TLE")
        {
            TLE++;
        }
        if(s[i]=="WA")
        {
            WA++;
        }
        if(s[i]=="RE")
        {
            RE++;
        }
    }
    cout<<"AC x "<<AC<<endl;
    cout<<"WA x "<<WA<<endl;
    cout<<"TLE x "<<TLE<<endl;
    cout<<"RE x "<<RE<<endl;
}

Measured memory_bytes: 6752
#include <iostream>
#include <vector>

using namespace std;

const int MOD = 1000 * 1000 * 1000 + 7;

int addm(int a, int b)
{
	return (0LL + a + b) % MOD;
}

int mulm(int a, int b)
{
	return (1LL * a * b) % MOD;
}

int main()
{
	int n, m;
	cin >> n >> m;
	vector<int> x(n);
	vector<int> y(m);
	for (auto& e : x) cin >> e;
	for (auto& e : y) cin >> e;

	int sx = 0;
	for (int i = 0; i + 1 < n; ++i) {
		sx = addm(sx, mulm((i + 1), mulm((n - 1 - i), (x[i + 1] - x[i]))));
	}
	int sy = 0;
	for (int j = 0; j + 1 < m; ++j) {
		sy = addm(sy, mulm((j + 1), mulm((m - 1 - j), (y[j + 1] - y[j]))));
	}
	int ans = mulm(sx, sy);
	cout << ans << endl;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(void){
    long a, b;
    char op;
    
    scanf("%ld %c %ld\n", &a, &op, &b);
    
    while(op != '?'){
        switch(op){
            case '+': printf("%ld\n", a+b); break;
            case '-': printf("%ld\n", a-b); break;
            case '/': printf("%ld\n", a/b); break;
            case '*': printf("%ld\n", a*b); break;
        }
        scanf("%ld %c %ld\n", &a, &op, &b);
    }
    
    return 0;
}


Measured memory_bytes: 2044
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <utility>

class UnionFind {
  public:
    UnionFind(int n = 0) {
      init(n);
    }
    void init(int n) {
      p_.resize(n);
      for (int i = 0; i < n; ++i) {
        p_[i] = i;
      }
    }
    int parent(int id) {
      if (p_[id] == id) {
        return id;
      } else {
        return p_[id] = parent(p_[id]);
      }
    }
    void join(int a, int b) {
      p_[parent(b)] = parent(a);
    }
    bool is_same(int a, int b) {
      return parent(a) == parent(b);
    }
    bool is_representative(int id) {
      return parent(id) == id;
    }
  private:
    std::vector<int> p_;
};

int main() {
  UnionFind uf;
  int n, q, c, x, y;
  std::cin >> n >> q;
  uf.init(n);
  for (int i = 0; i < q; ++i) {
    std::cin >> c >> x >> y;
    if (c == 0) {
      uf.join(x, y);
    } else {
      std::cout << uf.is_same(x, y) << std::endl;
    }
  }
  return 0;
}

Measured memory_bytes: 1240
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <limits.h>
#include <bitset>
#include <math.h>
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 10007;
const int INF = LLONG_MAX/3;
const int MAX = 710000;

/*-----Library-----*/

struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク
    vector<int> sizeuf; //要素数
    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n); sizeuf.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
            sizeuf[i]=1;
        }
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        sizeuf[x]+=sizeuf[y];
        return true;
    }

    int size(int x){
        return sizeuf[root(x)];
    }
};

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

long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*-----Library-----*/
signed main(){
    int x;
    cin>>x;
    int cnt=1;
    while(1){
        if(x-100*cnt>cnt*5){
            cnt++;
            continue;
        }else if(x-100*cnt<=cnt*5&&cnt*0<=x-100*cnt){
            cout<<1<<endl;
            return 0;
        }else {
            cout<<0<<endl;
            return 0;
        }
    }
}



Measured memory_bytes: 256
v, e = map(int, input().split())
indeg = [0]*v
uv = [[] for _ in range(v)]
for i in range(e):
    s, t = map(int, input().split())
    uv[s].append(t)
    indeg[t] += 1

'''
topologicalSort
トポロジカルソート
'''
visited = [False]*v
ans = []
for i in range(v):
    if indeg[i] == 0 and not visited[i]:
        q = [i]
        visited[i] = True
        while len(q) > 0:
            u = q.pop(0)
            ans.append(u)
            for v in uv[u]:
                indeg[v] -= 1
                if indeg[v] == 0 and not visited[v]:
                    visited[v] = True
                    q.append(v)

for v in ans:
    print(v)



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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplece_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    int2(n, b);
    int ans = INF;
    for (int i = 0; i < (1 << n); i++) {
        int tmp = 1, cnt = i;
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                tmp += b;
            } else {
                tmp *= 2;
            }
        }
        ans = min(ans, tmp);
    }

    cout << ans << endl;




    return 0;
}



Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#define min(a,b) ((a)<=(b)?(a):(b))
#define rep(i,n) for(int i=0;i<n;i++)
int dp[2][5002][2],cost[9999];
int main() {
	int N;
	scanf("%d",&N);
	rep(i,N-1) scanf("%d",&cost[i]);
	memset(dp,0x7f,sizeof(dp));
	dp[0][1][0]=dp[0][0][1]=0;
	rep(i,N-1) {
		int m=min(i+2,N/2);
		rep(j,m+1) {
			dp[(i+1)&1][j+1][0]=min(dp[i&1][j][0],dp[i&1][j][1]+cost[i]);
			dp[(i+1)&1][j][1]=min(dp[i&1][j][0]+cost[i],dp[i&1][j][1]);
		}
		memset(dp+(i&1),0x7f,5001*2);
	}
	printf("%d\n",min(dp[1][N/2][0],dp[1][N/2][1]));
}

Measured memory_bytes: 1148
#include <stdio.h>

int main(){
  int d,n;
  scanf("%d %d",&d,&n);
  if(n == 100) n += 1;
  if(d == 0)printf("%d\n",n);
  else if(d == 1)printf("%d\n",100*n);
  else if(d == 2)printf("%d\n",10000*n);
  return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int partition(int *A,int p,int r){
  int x,i,j,z;

  x = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i++;
      z = A[i];
      A[i] = A[j];
      A[j] = z;
    }
  }
  z = A[i+1];
  A[i+1] = A[r];
  A[r] = z;

  return i+1;
  
};

int main(){
  
  int n,a,i;
  
  scanf("%d",&n);

  int A[n];

  for(i=0;i<n;i++)
    scanf("%d",&A[i]);
 
  

 a = partition(&A[0],0,n-1);

  for(i=0;i<n;i++){
    if(i) printf(" ");
    if(i==a)printf("[%d]",A[i]);
    else printf("%d",A[i]);
  }
  printf("\n");

  return 0;
}



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


int main(){
  int n; cin >> n;
  int m = n/1.08;
  int r = m*1.08;
  int s = (m+1)*1.08;
  if(r == n)cout << m << endl;
  else if(s == n)cout << m + 1 << endl;
  else cout << ":(" << endl;
}

Measured memory_bytes: 256
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;

int32_t N;
int64_t sum[210000];

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N;
	for (size_t i = 0; i < N; i++)
	{
		in >> sum[i];
	}
	for (size_t i = 1; i <= N; i++)
	{
		sum[i] += sum[i-1];
	}

	auto res = sum[N];
	for (size_t i = 0; i < N; i++)
	{
		res = std::min(res, std::abs((sum[N] - sum[i]) - sum[i]));
	}
	out << res << endl;


	return 0;
}
#endif


Measured memory_bytes: 1792
#![allow(unused_imports)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

//
// Macro debug!
//

#[cfg(debug_assertions)]
include!{"./procon/debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

//
// Macro input!
//

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//
// IteratorExt
//

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}


//
// Main
//

fn main() {
    input! {
        n: usize,
        xs: [u64; n],
    }

    let ans = if solve(xs) { "Yes" } else { "No" };
    println!("{}", ans);
}

fn solve(xs: Vec<u64>) -> bool {
    if xs.iter().all(|&x| x == 0) {
        return true;
    } else if xs.len() % 3 != 0 {
        return false;
    } else {
        let a = *(xs.iter().min().unwrap());
        let b = *(xs.iter().max().unwrap());
        let c = a ^ b;
        let a_count = xs.iter().filter(|&&x| x == a).count();
        let b_count = xs.iter().filter(|&&x| x == b).count();
        let c_count = xs.iter().filter(|&&x| x == c).count();
        let count = xs.len() / 3;

        if a == 0 {
            a_count == count && b_count == 2 * count
        } else {
            a_count == count && b_count == count && c_count == count
        }
    }
}


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

int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if((a+b) > (c+d))
    cout << "Left" << endl;
  else if((a+b) == (c+d))
    cout << "Balanced" << endl;
  else 
    cout << "Right" << endl;
  // ここにプログラムを追記
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <functional>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <bitset>
#include <complex>
#define ll long long
#define INF 1000000000000000001
#define MOD 1000000007
using namespace std;

int main(){
    int N;
    cin >> N;
    int cnt=0;
    int temp=0;
    for(int i=0; i<N; i++){
        int d1,d2;
        cin >> d1>>d2;
        if(d1==d2){
            cnt++;
        }else{
            cnt=0;
        }
        temp=max(temp,cnt);
    }
    if(temp>=3){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3620
package main

import (
	"fmt"
)

func main() {
	var n int
	var s string
	fmt.Scan(&n,&s)
	
	cnt := 0
	for i := 2; i < n; i++ {
		if s[i-2] == 'A' && s[i-1] == 'B' && s[i] == 'C' {
			cnt++
		}
	}
	fmt.Println(cnt)
}

Measured memory_bytes: 512
n, m = map(int, raw_input().split())
x = map(int, raw_input().split())

if n >= m:
    print 0
else:
    x.sort()
    l = []
    for i in range(m - 1):
        l.append(x[i + 1] - x[i])
    l.sort(reverse=True)
    sum = sum(l[:n - 1])
    print x[m - 1] - x[0] - sum

Measured memory_bytes: 11276
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<bitset>
using namespace std;

typedef long long ll;
#define rep(i, n) for(int i = 0;i < (n);i++)
#define repr(i, n) for(int i = (n);i >= 0;i--)
#define repf(i, m, n) for(int i = (m);i < (n);i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1;} return 0;}
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
//////////////////////////////////////////////////


int main() {
    string s; cin >> s;
    rep(i,3) {
        if (s[i] == '7') {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
int main()
{ 
  int a,b,c;
  scanf("%d",&a);
  b=a%10;
  c=a/10;
  if(b==9)
    printf("Yes\n",a);
  else
    if(c==9)
      printf("Yes\n",a);
    else
      printf("No\n",a);
  return 0;   
}

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

typedef long long ll;

const int N = 200001;
int A[N];
int n, k, t, res, sum;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        cin >> t;
        A[i] = t + 1;
    }

    for (int i = 0; i < k; ++i) {
        sum += A[i];
    }
    res = sum;
    for (int i = k; i < n; ++i) {
        sum += A[i] - A[i - k];
        res = max(res, sum);
    }

    cout << setprecision(10) << fixed << ((float) res) / 2 << endl;

    return 0;
}



Measured memory_bytes: 1024
#include <cstdio>
#include <cmath>

using namespace std;

#define EPS (1e-10)
#define equals( A, B ) (fabs((A) - (B)) < EPS)

class Point {
public:
    double x, y;
    Point( double x = 0, double y = 0 ): x(x), y(y) {}
    
    Point operator + ( Point p ) { return Point( x + p.x, y + p.y ); }
    Point operator - ( Point p ) { return Point( x - p.x, y - p.y ); }
    Point operator * ( double a ) { return Point( a * x, a * y ); }
    Point operator / ( double a ) { return Point( x / a, y / a ); }

    double abs() { return sqrt( norm() ); }
    double norm() { return x * x + y * y; }

    bool operator < ( const Point &p ) const {
	return ( x != p.x ) ? x < p.x : y < p.y;
    }

    bool operator == ( const Point &p ) const {
	return equals( x, p.x ) && equals( y, p.y ); 
    }

    double dot( Point a ) { return x * a.x + y * a.y; }
    double cross( Point a ) { return x * a.y - y * a.x; }
};

typedef Point Vector;


class Line {
public:
    Point p1, p2;
    Line( Point p1 = Point(), Point p2 = Point() ): p1(p1), p2(p2) {}
    // ?????´????????????( cos = 0 )
    bool isOrthogonal( Line a ) {
	return equals( 0.0, (p1 - p2).dot( a.p1 - a.p2 ) );
    }
    // ??????????????????( sin = 0 )
    bool isParallel( Line a ) {
	return equals( 0.0, (p1 - p2).cross( a.p1 - a.p2 ) );
    }

    Point projection( Point p ) {
	Vector v12 = p2 - p1;
	double r = v12.dot( p - p1 ) / v12.norm();
	
	return p1 + v12 * r;
    }

    Point reflection( Point p ) {
	return p + ( projection( p ) - p ) * 2.0;
    }

};

typedef Line Segment;


int main()
{
    Point p1, p2;
    int q;

    scanf( "%lf %lf %lf %lf", &p1.x, &p1.y, &p2.x, &p2.y );
    scanf( "%d", &q );

    Line l12 = Line( p1, p2 );
    // l12.p1 = p1;
    // l12.p2 = p2;

    for ( int i = 0; i < q; i++ ) {
	Point p;
	scanf( "%lf %lf", &p.x, &p.y );

	Point ref = l12.reflection( p );
	
	printf("%.10lf %.10lf\n", ref.x, ref.y);
    }

    

    return 0;
}

Measured memory_bytes: 1100
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << x << "\n"
#define int long long
using namespace std;
using point = pair< int,int >;
using ll = long long;

signed main() {
    int n, m;
    string s, t;

    cin >> n >> m;
    cin >> s >> t;

    int lcm = n / __gcd(n, m) * m;
    map< int, char > mp;

    REP (i, n) {
        mp[i * lcm / n] = s[i];
    }

    bool flg = false;

    REP (i, m) {
        if (mp.find(i * lcm / m) != mp.end() && mp[i * lcm / m] != t[i]) {
            fprintf(stderr, "mp : %c, t : %c\n", mp[i * lcm / m], t[i]);
            flg = true;
        }
    }

    OUT((flg ? -1 : lcm));

    return 0;
}



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

int main(){
  int a,b;
  cin>>a>>b;
  if(a>0) cout<<"Positive";
  else if(a<0){
    if(b>=0) cout<<"Zero";
    else{
      if((b-a+1)%2==0) cout<<"Positive";
      else cout<<"Negative";
    }
  }else cout<<"Zero";
  cout<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define endl enjoy_codeforces
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    int n;std::cin>>n;
    int ht=0,cost=0;
    while(n--){
        int z;std::cin>>z;
        int a=0,b=0;
        for(;z>1;z>>=1){
            a++;
            b|=z&1;
        }
        b+=a;
        if(ht<=a)cost+=b-ht,ht=b;
        else ht=a;
    }
    std::cout<<cost<<'\n';
}


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

template<typename T>
istream& operator >> (istream& istr, vector<T>& vec){
    for(T& x: vec) istr >> x;
    return istr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<T>& vec){
    if(!vec.empty()){
        ostr << vec.front();
        for(auto itr = ++vec.begin(); itr != vec.end(); itr++)
            ostr << " " << *itr;
    }
    return ostr;
}

template<typename T>
ostream& operator << (ostream& ostr, vector<vector<T>>& mat){
    if(!mat.empty()){
        ostr << mat.front();
        for(auto itr = ++mat.begin(); itr != mat.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, pair<T,U>& p){
    ostr << p.first << " " << p.second;
    return ostr;
}

template<typename T, typename U>
ostream& operator << (ostream& ostr, vector<pair<T,U>>& mat){
    if(!mat.empty()){
        ostr << mat.front();
        for(auto itr = ++mat.begin(); itr != mat.end(); itr++)
            ostr << endl << *itr;
    }
    return ostr;
}

typedef long long ll;
typedef vector<ll> vll;
typedef vector<char> vc;
// vll x(n); x[i]=a;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
// vvll x(m,vi(n)); x[i][j]=a;
typedef pair<ll,ll> pll;
typedef vector<pair<ll,ll>> vpll;
// vpll x(n); x[i]={a,b}; x[i].first/second;

#define PI 3.1415926535897932
#define INF 1e+12
#define EPS 1e-12
#define REP(i,n) for(ll i=0; i<(n); i++)
#define RREP(i,n) for(ll i=(n)-1; i>=0; i--)
#define FOR(i,a,b) for(ll i=(a); i<(b); i++)
#define FORR(i,a,b) for(ll i=(b)-1; i>=(a); i--)
#define dump(x) cout << #x << " = " << (x) << endl
#define all(x) (x).begin(),(x).end()
// sort(all(x))

ll bfs(vvc &s, ll h, ll w, ll x, ll y){
    ll qx = x, qy = y, nx, ny, ans = 0;
    vll dx{1, -1, 0, 0}, dy{0, 0, 1, -1};
    vvll v(h, vll(w, 0));
    vpll qu(1, pll {qx,qy});
    v[qx][qy] = 1;

    while(qu.size()){
        vpll qu_new;
        REP(i,qu.size()){
            qx = qu[i].first;
            qy = qu[i].second;

            REP(j,4){
                nx = qx+dx[j];
                ny = qy+dy[j];
                // cout << nx << ny << endl;
                if (nx < 0 || nx >= h || ny < 0 || ny >= w) continue;
                if (s[nx][ny] == '#' || v[nx][ny] == 1) continue;
                v[nx][ny] = 1;
                qu_new.emplace_back(pll {nx, ny});
            }
        }
        qu = qu_new;
        ans++;
    }
    ans--;
    return ans;
}

int main(){
    ll h, w, len, ans = 0;
    cin >> h >> w;
    vvc s(h, vc(w));
    cin >> s;

    REP(i,h){
        REP(j,w){
            if(s[i][j] == '#') continue;
            len = bfs(s, h, w, i, j);
            if(len > ans) ans = len;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256