akhauriyash/Code-Regression huggingface dataset:
N=int(input())
n=1
sum=0
while n<=N :
    if n%5==0 and n%3==0 :
        sum=sum+0
        n+=1
        continue
    elif n%5==0:
        sum=sum+0
        n+=1
        continue
    elif n%3==0:
        sum=sum+0
        n+=1
        continue
    else :
        sum=sum+n
        n+=1
        continue
print(sum)


Measured memory_bytes: 9016
#include<stdio.h>

int main(){
  int M[101][101];
  int n, n1, n2, n3; 
  int i, j;

  scanf("%d",&n);

  for ( i = 1; i <=n; i++ )
    {
      for ( j = 1; j <=n; j++ ) 
	{
	  M[i][j] = 0;
	}
    }
  
  for ( i = 1; i <= n ; i++ )
    {
      scanf("%d %d",&n1,&n2);
      
      for ( j = 1; j <= n2 ; j++ )
	{
	  scanf("%d",&n3);
	  
	  M[i][n3] = 1;
	}
    }
  
  for ( i = 1; i <= n ; i++ )
    {
      for ( j = 1; j < n ; j++ )
	{
	  printf("%d ",M[i][j]);

	}
      printf("%d",M[i][j]);
      printf("\n");
    }
 
  return 0;
}

Measured memory_bytes: 640
/*
	Name:
	Author: xiaruize
	Date:
*/

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second

inline int read()
{
    char ch=getchar();
    int x=0,f=1;
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=getchar();
    return x*f;
}

int main()
{
 	ios::sync_with_stdio(false);
	cin.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]!=s[s.size()-1-i])
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	for(int i=0;i<s.size()/2;i++)
	{
		if(s[i]!=s[s.size()/2-1-i]||s[(s.size()+1)/2+i]!=s[s.size()-1-i])
		{
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
from math import sqrt, ceil

N = 53000
temp = [True]*(N+1)
temp[0] = temp[1] = False
for i in range(2, ceil(sqrt(N+1))):
    if temp[i]:
        temp[i+i::i] = [False]*(len(temp[i+i::i]))

while True:
    try:
        n = int(input())
        print(n-1-temp[n-1:0:-1].index(True), n+1+temp[n+1:].index(True))
    except EOFError: break


Measured memory_bytes: 6636
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
map<char,int> m={{'A',1},{'G',2},{'C',3},{'T',4},{'*',5}};
vector<int> AGCT={'A','G','C','T'};
int n,dp[110][9][9][9];
bool chk(vector<int> C)
{
  return C[0]=='A' and C[1]=='G' and C[2]=='C';
}
int solve(int idx,int c3,int c2,int c1)
{
  if(idx>=n) return !chk({c3,c2,c1});
  if(dp[idx][m[c3]][m[c2]][m[c1]]!=-1) return dp[idx][m[c3]][m[c2]][m[c1]];
  int ret=0;
  for(char now:AGCT)
  {
    vector<int> t={c3,c2,c1,now};
    bool ok=true;
    if(chk({c3,c2,c1}) || chk({c2,c1,now})) ok=false;
    for(int i=0;i<AGCT.size()-1;i++)
    {
      vector<int> tt=t;
      swap(tt[i],tt[i+1]);
      if(chk({tt[0],tt[1],tt[2]}) || chk({tt[1],tt[2],tt[3]})) ok=false;
    }
    if(ok)
    {
      int val=solve(idx+1,c2,c1,now);
      ret=(ret%mod+val%mod)%mod;
      if(ret<0) ret+=mod;
    }
  }
  return dp[idx][m[c3]][m[c2]][m[c1]]=ret;
}
int main()
{
  cin>>n;
  memset(dp,-1,sizeof(dp));
  cout<<solve(0,'*','*','*')<<endl;
  return 0;
}


Measured memory_bytes: 640
#include <stdio.h>
int main(int argc, char **argv){
	int a, b;
	scanf("%d", &a);
	scanf("%d\n", &b);
	if ((a % 3 == 0) || (b % 3 == 0) || ((a + b) % 3 == 0)) {
		printf("Possible\n");
		return 0;
	}
	printf("Impossible\n");
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)  //  repマクロ
#define leng(n) (int)(log10(n)+1)  //  桁数
using namespace std;

signed main() {
  int A, b, c, d, E, k;
  cin >> A >> b >> c >> d >> E >> k;
  if (E-A <= k) cout << "Yay!" << endl;
  else cout << ":(" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int  matrix[100000][3],f[100000][3];
int vacation(int i,int j)
{if(j==-1||j==3)
 return 0;
 if(f[i][j]!=-1) return f[i][j];
 if(j==0)
 f[i][j]=max(vacation(i-1,1)+matrix[i][j],vacation(i-1,2)+matrix[i][j]);
 else if(j==1)
 f[i][j]=max(vacation(i-1,0)+matrix[i][j],vacation(i-1,2)+matrix[i][j]);
 else if(j==2)
 f[i][j]=max(vacation(i-1,0)+matrix[i][j],vacation(i-1,1)+matrix[i][j]);
 return f[i][j];
}
int main()
{ int n;
cin>>n;
for(int i=0;i<n;++i)
for(int j=0;j<3;++j)
cin>>matrix[i][j];
memset(f,-1,sizeof(f));
f[0][0]=matrix[0][0],f[0][1]=matrix[0][1],f[0][2]=matrix[0][2];
int max=0;for(int i=0;i<3;++i)
{f[n-1][i]=vacation(n-1,i);
 if(f[n-1][i]>max)
 max=f[n-1][i];
	
}

	
	cout<<max;
	
}

Measured memory_bytes: 7296
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
#define MOD 1000000007
using namespace std;

int main(void){
    int n,k;
    cin >> n >> k;
    cout << ((n+1)/2>=k?"YES":"NO") << endl;
    return 0;
}


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

int main(){
    int N,K,X,Y;
    cin >> N >>K >> X >>Y;
    ll ans =0;
    for(int i=1;i<=N;i++){
        if(i<=K){
            ans +=X;
        }else{
            ans += Y;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char c;
  cin >> c;
  string hantei = "consonant";
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
    hantei = "vowel";
  }
  
  cout << hantei << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define eb emplace_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
// #define ll int
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[8] ={1,0,-1,0,1,-1,1,-1};
ll dy[8] ={0,1,0,-1,1,-1,-1,1};
 
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; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


void solve(){
    ll n,m;
    cin>>n>>m;
    string a[60],b[60];
    rep(i,n) cin>>a[i];
    rep(i,m) cin>>b[i];
    rep(i,n){
        if(i+m>n) break;
        rep(j,n){
            if(j+m>n) break;
            bool ok=true;
            rep(k,m){
                rep(l,m){
                    if(a[i+k][j+l]!=b[k][l]){
                        ok=false;
                    }
                }
            }
            if(ok){
                cout<<"Yes"<<endl;
                return ;
            }
        }
    }
    cout<<"No"<<endl;
    return ;

}

 
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
     
    solve();


    return 0;
}

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

int main(){
  string s; cin >>s;
  int n = s.size();
  if(n<26){
    map<char, int> mp;
    rep(i,n) mp[s[i]]++;
    for(char c = 'a'; c<='z'; c++){
      if(mp[c]==0) {
        cout << s << c << endl;
        return 0;
      }
    }
  }
  if(s=="zyxwvutsrqponmlkjihgfedcba"){
    cout << -1 << endl;
    return 0;
  }
  string t = s;
  next_permutation(t.begin(), t.end());
  rep(i,26){
    cout << t[i];
    if(s[i]!=t[i]) break;
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 3636
N = int(input())
S = list(str(input()))

max = 0
count = 0
check = []

for i in range(1,N):
  count = 0
  check = []
  left = S[:i]
  right = S[i:]
  for j in left:
    if j in right and j not in check:
      count += 1
    check.append(j)
  if count >= max:
    max = count
    
print(max)

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

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

  vector<int> x(m);

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

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

  vector<int> dif(m-1);
  for(int i = 0;i < m-1;i++){
    dif[i] = x[i+1] - x[i];
  }

  sort(dif.begin(),dif.end(),greater<int>());

  long long ret = x[m-1] - x[0];

  for(int i = 0;i < n-1 && i < m-1;i++){
    ret -= dif[i];
  }

  cout << ret << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

bool solve(const std::vector<std::string> &hlines, int n, int m, int g, int d){
	bool ret = false;
	int cur_p = m - 1;

	for(int y = 0; y < d; y++){
		if(cur_p >= 1 && hlines[y][cur_p - 1] == '1'){
			cur_p--;
		}
		else if(hlines[y][cur_p] == '1'){
			cur_p++;
		}
	}
	ret = (cur_p + 1 == g);

	return ret;
}

int main(int argc, char **argv){
	int n, m, g, d;
	std::string buf;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> n){
#else
	while(std::cin >> n){
#endif
		if(n == 0){ break; }
		std::vector<std::string> hlines;

#if INPUT_FROM_FILE
		ifs >> m >> g >> d;
#else
		std::cin >> m >> g >> d;
#endif

#if INPUT_FROM_FILE
		std::getline(ifs, buf);
#else
		std::getline(std::cin, buf);
#endif
		for(int y = 0; y < d; y++){
#if INPUT_FROM_FILE
			std::getline(ifs, buf);
#else
			std::getline(std::cin, buf);
#endif
			hlines.push_back(buf);
		}

		if(solve(hlines, n, m, g, d)){
			std::cout << "0" << std::endl;
		}
		else{
			bool is_solved = false;
			for(int y = 0; y < d; y++){
				for(int x = 0; x < n - 1; x++){
					if(hlines[y][x] == '0'){
						if((x == 0 || (x > 0 && hlines[y][x - 1] == '0')) && (x == n - 2 || (x <= n - 2 && hlines[y][x + 1] == '0'))){
							std::vector<std::string> tmp = hlines;

							tmp[y][x] = '1';
							if(solve(tmp, n, m, g, d)){
								is_solved = true;
								std::cout << y + 1 << " " << x + 1 << std::endl;
								y = d;
								break;
							}
						}
					}
				}
			}

			if(!is_solved){
				std::cout << "1" << std::endl;
			}
		}
	}



#if INPUT_FROM_FILE
	//fclose(fp);
#endif
	return 0;
}



Measured memory_bytes: 3056
#include<bits/stdc++.h>
using namespace std;
long long arr[1000007];
long long cs[1000007];
long long ps[1000007];

int main()
{

    vector<int>v;
    string s;
    cin>>s;

    int cnt=0;
    int f=0;
    int g=0;

    for(int i=0; i<s.size(); i++)
    {

        if(s[i]=='R')
        {

            cnt++;
            f=1;
            g=1;
        }

        if(s[i]=='S')
        {
            //cout<<cnt<<endl;
            if(f==1)
                v.push_back(cnt);
            f=0;
            cnt=0;

        }
    }
    //cout<<cnt<<endl;
    if(s[s.size()-1]=='R')
        v.push_back(cnt);
    sort(v.begin(),v.end(), greater<int>());
    if(g==0)
        cout<<0<<endl;
    else
    cout<<v[0]<<endl;
}














Measured memory_bytes: 3600
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# AGC 030：A - Poisonous Cookies


def main():
    a, b, c = [int(n) for n in raw_input().strip().split(' ')]

    if a + b + 1 >= c:
        print b + c
    else:
        print a + b + 1 + b


if __name__ == '__main__':
    main()


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

int main()
{
  int n,k;
cin >> n >> k;
  
  vector<int> data(n);
  vector<int> score(n);
  for(int i=0; i<n; ++i) {
    cin >> data[i];
  }
  
  /*
  int tempScore = data[0];
  for(int i=1; i<k; ++i){
    tempScore *= data[i];
  }
  score[k-1] = tempScore;
  for(int i=k; i<n; ++i){
  	  tempScore /= data[i-k];
    tempScore *= data[i];
    score[i] = tempScore;
  }
  */
  
  for(int i=k; i<n; ++i) {
    if (data[i] > data[i-k]) {
      cout << "Yes" << endl;
    }
    else {
      cout << "No" << endl;
    }
     
  }
    return 0;
}

Measured memory_bytes: 4840
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#define llint long long

using namespace std;

llint n;
llint a[15][15];
llint f[105];

int main(void)
{
	cin >> n;
	a[1][2] = a[2][1] = 1;
	
	f[0] = 0, f[1] = 1, f[2] = 2;
	for(int z = 3; z <= 10; z++){
		f[z] = f[z-1];
		while(1){
			vector<llint> vec;
			for(int i = 1; i <= z; i++){
				vec.push_back(f[i]);
				for(int j = 1; j <= z; j++){
					if(i < j) vec.push_back(f[i]+f[j]);
				}
			}
			sort(vec.begin(), vec.end());
			bool flag = true;
			for(int i = 1; i < vec.size(); i++){
				if(vec[i-1] == vec[i]) flag = false;
			}
			if(flag) break;
			f[z]++;
		}
	}
	
	for(int i = 3; i <= n; i++){
		llint perm[10], m = 0;
		for(int j = 1; j <= i-1; j++) perm[j] = j;
		do{
			llint sum = 0;
			for(int j = 1; j < i-1; j++) sum += a[perm[j]][perm[j+1]];
			m = max(m, sum);
		}while(next_permutation(perm+1, perm+i));
		
		for(int j = 1; j < i; j++){
			a[i][j] = a[j][i] = (m+1)*f[j];
		}
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
/** Which of the favors of your Lord will you deny ? **/

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

#define LL long long
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define F first
#define S second

#define ALL(x)      (x).begin(), (x).end()
#define READ        freopen("alu.txt", "r", stdin)
#define WRITE       freopen("vorta.txt", "w", stdout)

#ifndef ONLINE_JUDGE
#define DBG(x)      cout << __LINE__ << " says: " << #x << " = " << (x) << endl
#else
#define DBG(x)
#define endl "\n"
#endif

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p);
template <class T>
ostream &operator <<(ostream &os, vector<T>&v);
template <class T>
ostream &operator <<(ostream &os, set<T>&v);

inline void optimizeIO()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

#define int long long

const int nmax = 2e5+7;
const int MOD = 1e9+7;

int dp[2005];
int add(int x,int y)
{
    return (x+y) % MOD;
}

int solve(int n)
{
    if(n==0) return 1;
    if(n<0) return 0;

    int &ret = dp[n];
    if(ret!=-1) return ret;

    ret = 0;

    for(int take = 3;take<=n;take++)
        ret = add (ret , solve(n-take) );

    return ret;
}

void solveTC()
{
    int n;
    cin>>n;

    memset(dp,-1,sizeof dp);
    int ans = solve(n);
    cout<<ans<<endl;
    DBG(ans);
}

int32_t main()
{
    optimizeIO();

    int tc = 1;

    while(tc--)
    {
        solveTC();
    }

    return 0;
}

/**

**/

template<class T1, class T2>
ostream &operator <<(ostream &os, pair<T1,T2>&p)
{
    os<<"{"<<p.first<<", "<<p.second<<"} ";
    return os;
}
template <class T>
ostream &operator <<(ostream &os, vector<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" " ;
    }
    os<<" ]";
    return os;
}

template <class T>
ostream &operator <<(ostream &os, set<T>&v)
{
    os<<"[ ";
    for(T i:v)
    {
        os<<i<<" ";
    }
    os<<" ]";
    return os;
}


Measured memory_bytes: 3592
import java.util.*;
import java.lang.*;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = sc.nextInt();
		Tree tree = new Tree(n);
		for (int i = 0; i < n - 1; i++) {
			tree.union(sc.nextInt() - 1, sc.nextInt() - 1);
		}
		for (int i = 0; i < q; i++) {
			tree.node[sc.nextInt() - 1].count += sc.nextInt();
		}
		boolean[] visited = new boolean[n];
		for (int i = 0; i < n; i++) {
			int tmp = tree.node[i].count;
			for (int num: tree.node[i].children) {
				if (visited[num]) {
					continue;
				}
				tree.node[num].count += tmp;
			}
			visited[i] = true;
		}
		for (int i = 0; i < n - 1; i++) {
			System.out.print(tree.node[i].count + " ");
		}
		System.out.println(tree.node[n - 1].count);
	}
}

class Node {
	TreeSet<Integer> children;
	int count;
	Node() {
		children = new TreeSet<>();
		count = 0;
	}
}

class Tree {
	Node[] node;
	Tree(int n) {
		node = new Node[n];
		for (int i = 0; i < n; i++) {
			node[i] = new Node();
		}
	}
	void union(int n, int m) {
		node[n].children.add(m);
		node[m].children.add(n);
	}
}


Measured memory_bytes: 238772
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+1;

vector<int>to[maxn];

int len,rt,n;

void dfs(int u,int f,int d){
	if (d>len) len=d,rt=u;
	for (auto v:to[u])
	if (v!=f) dfs(v,u,d+1);
}

int main(){
	scanf("%d",&n);
	for (int i=2;i<=n;++i){
		int u,v;
		scanf("%d%d",&u,&v);
		to[u].push_back(v);
		to[v].push_back(u);
	}
	dfs(1,0,0);dfs(rt,0,0);
	puts(len%3!=1?"First":"Second");
}

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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

#define pb push_back
#define INF 999999999
#define MOD 1000000007
#define sp ' '


//typedef
typedef long long ll;
typedef pair<int, int> pint;
typedef pair<long, long> pll;
typedef map<int, int> mint;
typedef set<int> sint;
typedef vector<int> vint;
typedef vector<char> vchr;
typedef vector<long long> vll;
typedef vector<string> vstr;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll a, ll b, ll c){ll ans=1; rep(i, b){ans=ans*a%c;} return ans;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}
template<typename T>
void dpp(T n){cerr << n << endl;}
template<typename T>
void vpp(T a){rep(i,a.size()){cout << a[i] << endl;}}
template<typename T>
void vdp(T a){rep(i,a.size()){cerr << a[i] << endl;}}

const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ddx[8] = {1,0,-1,0,1,-1,-1,1};
const int ddy[8] = {0,1,0,-1,1,1,-1,-1};

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    rep(i, 10){
        if(n <= (i+1)*111){
            ppp((i+1)*111);
            break;
        }
    }



    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
#define MOD 1000000007

int main(int argc, char const *argv[]) {
  int n,ans;
  std::cin >> n;

  if(n<105) ans=0;
  else if(n<135) ans=1;
  else if(n<165) ans=2;
  else if(n<189) ans=3;
  else if(n<195) ans=4;
  else ans=5;

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


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::str::*;
#[allow(unused_imports)]
use std::mem::*;
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::HashMap;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();
    line.trim().to_string().parse().ok().unwrap()
}

#[allow(dead_code)]
fn read_cols<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).unwrap();

    line.trim()
        .split_whitespace()
        .map(|s| s.parse().ok().unwrap())
        .collect()
}

fn main() {
    let num = read::<u32>();
    let mut points = read_cols::<u32>();

    let mut each_points = Vec::new();
    each_points.resize(2, 0);
    let mut next_player = 0;

    while !points.is_empty() {
        let (i, &p) = points.iter().enumerate().max_by(|kv, kv2| kv.1.cmp(kv2.1)).unwrap();
        each_points[next_player] += p;
        next_player += 1;
        next_player %= 2;
        points.swap_remove(i);
    }

    println!("{}", each_points[0] - each_points[1]);
}


Measured memory_bytes: 4352
#include <stdio.h>
int main()
{
int a,i,j,k,l,m,rank;
char mark;
int S[14]={},H[14]={},C[14]={},D[14]={};
scanf("%d",&a);
for(i=0;i<a;i++)
{
        scanf("%s %d",&mark,&rank);
        if(mark=='S'){S[rank]=1;}
        if(mark=='H'){H[rank]=1;}
        if(mark=='C'){C[rank]=1;}
        if(mark=='D'){D[rank]=1;}
}
 
for(j=1;j<14;j++)
{
    if(S[j]==0){printf("S %d\n",j);
    }
}
 
for(k=1;k<14;k++)
{
    if(H[k]==0){printf("H %d\n",k);
    }
}
 
for(l=1;l<14;l++)
{
    if(C[l]==0){printf("C %d\n",l);
    }
}
 
for(m=1;m<14;m++)
{
    if(D[m]==0){printf("D %d\n",m);
    }
}
return 0;
}

Measured memory_bytes: 596
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace test
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            var A = input[0];
            var B = input[1];
            var ans = 0;
            for(var i = A; i <= B; i++)
            {
                var S = i.ToString();
                if (S[0] == S[4] && S[1] == S[3]) ans++;
            }

            Console.WriteLine(ans);
        }
    }
}

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

#define MOD (1000000007)

using namespace std;

typedef long long ll;
typedef pair<ll, ll> tup;
const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];


ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


// テーブルを作る前処理
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;
}


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

    string S;
    cin >> S;

    map<char, ll> m;
    for(ll i = 0; i < S.size(); i++){
        m[S[i]]++;
    }

    ll ret = 1; // modpow(2, S.size(), MOD) ;

    for(auto itr=m.begin(); itr != m.end(); itr++) {
        ret *= (((itr->second) % MOD )+ 1) % MOD;
        ret %= MOD;
    }

    cout << ret - 1 << endl;

    // ll left = 0, right = 0;
    // map<char, ll> m;
    // ll ret = 0;

    // m[S[left]] = 1;
    // //ret++;
    // while(right <= N) {

    //     if(m[S[right]] >= 2) {
    //         cout << left << "," << right << "-> clear()" << endl;
    //         m.clear();
    //         left = right;
    //         m[S[left]] = 1;
    //     } else {
    //         ret += (right+1)-left;
    //         cout << left << "," << right << "-> +" <<(right+1)-left << endl;
    //         right++;
    //         m[S[right]]++;
    //     }
    // }

    return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			int N =scan.nextInt();
			int M =scan.nextInt();
			int []A = new int[M];
			long goukei = 0;
			for(int i = 0;i<M;i++) {
				A[i] = scan.nextInt();
				goukei+=A[i];
			}
			
			System.out.println(N-goukei>=0?N-goukei:-1);
			
			
		}
		
		
	}
		

}


Measured memory_bytes: 46168
n = int(input())
a = list(map(int,input().split()))
a.sort()
p = True
ans = 1
for i in a :
  ans *= i
  if(ans == 0) :
    print(0)
    p = False
    break
  if(ans > 1000000000000000000):
    print(-1)
    p =False
    break
if p:
  if ans > 1000000000000000000:
    print(-1)
  else:
    print(ans)



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

int main() {
  int answer = 0;
  string s;
  cin >> s;
  if (s[0] == '1') answer++;
  if (s[1] == '1') answer++;
  if (s[2] == '1') answer++;
  cout << answer << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <stack>
#include <memory.h>
#include <list>
#include <numeric>
#include <functional>
#include <complex>
#include <cassert>
#include <regex>
#include <random>

#define ll long long
#define ld long double
#define ull unsigned ll
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define pii pair<int,int> 
#define vi vector<int>
#define vpii vector<pii>
#define vvi vector<vector<int>>
#define forn(it,from,to) for(int (it)=from; (it)<to; (it)++)
const int  Inf = 2 * 1000 * 1000 * 1000;
ll LINF = (ll)4e18;
using namespace std;
#define M_PI       3.14159265358979323846   // pi

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("sum.in", "r", stdin);
	//freopen("sum.out", "w", stdout);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n, k;
	cin >> n >> k;
	vector<int>a(n);
	for (auto &x : a) cin >> x;
	
	vector<int>D(n + 1, 2e9);
	D[0] = 0;

	for (int i = 0; i < n; i++) {
		for (int j = 1; j <= k; j++) {
			if (i + j < n) {
				D[i + j] = min(D[i + j], D[i] + abs(a[i + j] - a[i]));
			}
		}
	}
	cout << D[n - 1];
 	return 0;
}

Measured memory_bytes: 1024
<?php

$conv = array_merge(
  array_combine(range("a", "z"), range("A", "Z")),
  array_combine(range("A", "Z"), range("a", "z"))
);

$input = trim(fgets(STDIN));
$data  = str_split($input);

foreach ($data as $c) {
  if (array_key_exists($c, $conv)) {
    echo $conv[$c];
  } else {
    echo $c;
  }
}
echo PHP_EOL;

Measured memory_bytes: 15328
n,m=map(int,input().split())
A=[0]*n
W=[0]*n
wa=0
ac=0
for _ in range(m):
    p,s=input().split()
    if s=="AC":
        A[int(p)-1]=1
    if s=="WA" and A[int(p)-1]!=1:
        W[int(p)-1]+=1
for i in range(n):
    if A[int(i)]==0:
        W[int(i)]=0

print(sum(A),sum(W))

Measured memory_bytes: 4596
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
//#include"testlib.h"
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define watch(x) cout << (#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> row;
typedef vector<row> matrix;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("street.in", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

int main() {
	//file();
	fast();
	ll ans = 0;
	int k, s; cin >> k >> s;
	for (int x = 0; x <= k; x++) {
		for (int y = 0; y <= k; y++) {
			int z = s - (x + y);
			if (z >= 0 && z <= k)ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
import           Data.Maybe
import           Data.Int
import           Data.List
import           Data.Char
  -- import qualified Data.Vector.Unboxing as VU
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import           Data.List (scanl')
import           Data.IORef
import           Control.Monad
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Control.Applicative
import           Debug.Trace
import           Text.Printf


readInt = BS.readInt . BS.dropWhile isSpace
getVector f = VU.unfoldr f <$> BS.getLine
getIntVector = getVector readInt
getBSVector = getVector BS.uncons
getInt = readLn :: IO Int

main = do
  n <- getInt
  s <- VU.fromList <$> getLine
  -- print $ cond1AndNotCond2 s $ notCond2 n
  print $ (rgbNumber s) - (cond1AndNotCond2 s $ notCond2 n)

notCond2 n = do
  i <- [0..n-3]
  j <- [i..n-2]
  let k = 2*j - i
  guard $ k < n
  -- guard $ s VU.! i /= s VU.! j && s VU.! j /= s VU.! k && s VU.! k /= s VU.! i
  return (i,j,k)

cond1AndNotCond2 s ijk = foldl' (\n m -> n + (cond1 m)) 0 ijk
  where
    cond1 (i,j,k) = if s VU.! i /= s VU.! j && s VU.! j /= s VU.! k && s VU.! k /= s VU.! i
                    then 1
                    else 0

rgbNumber :: VU.Vector Char -> Int
rgbNumber s = diffRGB $ VU.foldl' (\n m -> addTuple n $ check m) (0,0,0) s
  where
    check c = case c of 'R' -> (1,0,0)
                        'G' -> (0,1,0)
                        'B' -> (0,0,1)
                        _   -> undefined
    addTuple (i,j,k) (i',j',k') = (i+i',j+j',k+k')
    diffRGB (i,j,k) = i*j*k


Measured memory_bytes: 4648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>
#include <fstream>
#include <bitset>
#include <time.h>
#include <tuple>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e12;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,N) for(int i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll sq(ll num) { return num*num; }
ll mod_pow(ll x, ll n) {
	if (n == 0)return 1;
	if (n == 1)return x%MOD;
	ll res = sq(mod_pow(x, n / 2));
	res %= MOD;
	if (n % 2 == 1) {
		res *= x;
		res %= MOD;
	}
	return res;
}
ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

int n;
string s[1000];

bool check(int x) {
	rep(i, n) {
		rep(j, n) {
			if (s[i][j + x] != s[j][i + x])return false;
		}
	}
	return true;
}

int main() {
	cin >> n;
	rep(i, n) {
		cin >> s[i];
		s[i] += s[i];
		s[i + n] = s[i];
	}
	ll ans = 0;
	rep(i, n) {
		if (check(i))ans += n;
	}
	cout << ans << endl;
}

Measured memory_bytes: 768
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]

good_list = [1]*N
for i in range(M):
    if H[AB[i][0]-1] > H[AB[i][1]-1]:
        good_list[AB[i][1]-1] = 0
    elif H[AB[i][0]-1] == H[AB[i][1]-1]:
        good_list[AB[i][0] - 1] = 0
        good_list[AB[i][1] - 1] = 0
    else:
        good_list[AB[i][0] - 1] = 0

print(good_list.count(1))


Measured memory_bytes: 32028
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;cin>>s;
	bool f=false;
	for(int i=0;i<3;i++)
	{
		if(s[i]=='7')f=true;
	}
	if(f)cout<<"Yes"<<endl;
	else
	cout<<"No"<<endl;
	return 0;
 } 

Measured memory_bytes: 3624
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n, k;
	cin >> n >> k;
	vector<mint> left(n+2, 0), right(n+2, 0);
	for(int i = 0; i <= n; ++i){
		left[i+1] = left[i] + i;
	}
	for(int j = 1; j <= n+1; ++j){
		right[j] = right[j-1] + n + 1 - j;
	}
	mint ans = 0;
	for(int i = k; i <= n+1; ++i){
		ans += right[i] - left[i] + 1;
	}
	cout << ans.x << endl;
	return 0;
}

Measured memory_bytes: 6332
#include<bits/stdc++.h>
using namespace std;
int main(){
	int A,B,C,X,Y,res=0;
	scanf("%d%d%d%d%d",&A,&B,&C,&X,&Y);
	while(X > 0 && Y > 0){
		res += min(A+B, 2*C);
		X --;
		Y --;
	}
	while(X > 0){
		res += min(A, 2*C);
		X --;
	}
	while(Y > 0){
		res += min(B, 2*C);
		Y--;
	}
	printf("%d\n",res);
	return 0;
}


Measured memory_bytes: 256
N,D=map(int,input().split())
from itertools import combinations
l=[]
ans=0
for i in range(N):
  l.append(list(map(int,input().split())))
for m,n in combinations(l,2):
  sv=0
  for a in range(D):
    sv+=(abs(m[a]-n[a]))**2
  if sv**(1/2)%1==0:
    ans+=1
print(ans)

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

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)((x).size()))

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef long long int64;
typedef unsigned int uint;
typedef unsigned long long uint64;

#define gi(x) ((x) = F())
#define gii(x, y) (gi(x), gi(y))
#define giii(x, y, z) (gii(x, y), gi(z))

int F()
{
	char ch;
	int x, a;
	while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-');
	if (ch == '-') ch = getchar(), a = -1;
	else a = 1;
	x = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9')
		x = (x << 1) + (x << 3) + ch - '0';
	return a * x;
}

int n, m;

char str[20][20];

int main()
{
	gii(n, m);
	for (int i = 1; i <= n; ++i) scanf("%s", str[i] + 1);
	int x = 1, y = 1;
	if (str[x][y] == '.')
	{
		puts("Impossible");
		return 0;
	}
	int cnt = 0;
	for (int i = 1; i <= n; ++i) for (int j = 1; j <= m; ++j) cnt += (str[i][j] == '#');
	for (int i = 1; i < cnt; ++i)
	{
		if (str[x + 1][y] == '#') ++x;
		else if (str[x][y + 1] == '#') ++y;
		else 
		{
			puts("Impossible");
			return 0;
		}
	}
	puts("Possible");
	return 0;
}



Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    tmp0 = input[0].split(" ");
    tmp1 = input[1].split(" ");
    var n = parseInt(tmp0[0], 10);
   //  console.log(n);
    var ans='APPROVED ';
    for(i=0;i<n;i++){var a = parseInt(tmp1[i], 10);
                 //    console.log(a);
                if(a%2==0){if(a%3==0||a%5==0){var ans ='APPROVED'; }
                                       else{var ans='DENIED';
                                                      break;}
                        //  console.log(ans);
                          }
                    }
    console.log(ans);
                }
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
import sys
sys.setrecursionlimit(100000)

def load_balls():
	LINE_NUM, TOTAL = 0, 0
	balls = []
	i = 0
	for line in sys.stdin:
		line = line.strip()
		LINE_NUM += 1
		if LINE_NUM == 1:
			TOTAL = int(line.strip())
			continue
		balls.append([int(i) for i in line.split(" ")])
		if LINE_NUM == TOTAL+1: break
	return balls

class VesselClass:

	def __init__(self):
		self.tmp = []
		self.left = [0]
		self.right = [0]

	def fill(self, balls:list):
		self.tmp = balls

	def DFS(self):
		if len(self.tmp) == 0: print("YES")
		elif self.left[-1] < self.tmp[0]:
			self.left.append(self.tmp[0])
			self.tmp.pop(0)
			self.DFS()
		elif self.right[-1] < self.tmp[0]:
			self.right.append(self.tmp[0])
			self.tmp.pop(0)
			self.DFS()
		else: print("NO")

balls_list = load_balls()
for balls in balls_list:
	Vessel = VesselClass()
	Vessel.fill(balls)
	Vessel.DFS()

Measured memory_bytes: 7600
#include <iostream>
#include <vector>
#include <list>
#include <unordered_set>
#include <set>
#include <unordered_map>
#include <map>
#include <stack>
#include <queue>
#include <cassert>
#include <cmath>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <fstream>
#include <tuple>

//....................................................................................................................//

using std::cin;
using std::cout;
using std::vector;
using std::list;
using std::unordered_set;
using std::set;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::pair;
using std::make_pair;
using std::min;
using std::max;
using std::swap;
using std::stack;
using std::deque;
using std::queue;
using std::ios_base;
using std::ifstream;
using std::ofstream;
using std::string;
using std::tuple;
using std::make_tuple;
using std::get;
using std::upper_bound;
using std::lower_bound;
using std::max_element;
using std::min_element;

//....................................................................................................................//

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned long ul;

[[maybe_unused]] const string endl = "\n";
[[maybe_unused]] const string sep = " ";
[[maybe_unused]] const string yes = "OK\n";
[[maybe_unused]] const string no = "NG\n";
[[maybe_unused]] const double pi = acos(-1);

//....................................................................................................................//



int main() {
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    cout.precision(10);
    ll x;
    cin >> x;
    ll sum = 100;
    int counter = 0;
    while (sum < x) {
        ++counter;
        sum *= 1.01;
    }
    cout << counter;
    return 0;
}

Measured memory_bytes: 3192
import java.util.Arrays;
import java.util.Scanner;





public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a,b,c = 0;
		a = sc.nextInt();
		b = sc.nextInt();
		c = sc.nextInt();

		int[] aaa = {a,b,c};

		Arrays.sort(aaa);

        System.out.print(aaa[0] + " ");
        System.out.print(aaa[1] + " ");
        System.out.println(aaa[2]);
        /*
		for(int i : aaa) {
            System.out.print(i + " ");
		}
		*/
	}

}



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

int main(){
    ll n,q;cin>>n>>q;
    string s;cin>>s;

    vl cnt(n);
    for(ll i=1;i<n;i++){
        if(s[i-1]=='A'&&s[i]=='C')cnt[i]=cnt[i-1]+1;
        else cnt[i]=cnt[i-1];
    }//累積和


rep(i,q){
    ll l,r;cin>>l>>r;l--;r--;
    cout<<cnt[r]-cnt[l]<<endl;
}


}


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

char square[52][52];
int high, width,
    dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(void){
    cin >> high >> width;
    
    int i, j;
    for(i = 1; i <= high; i++){
        for(j = 1; j <= width; j++)    cin >> square[i][j];
    }
    
    bool haveBlack;
    
    for(i = 1; i <= high; i++){
        for(j = 1; j <= width; j++){
            if(square[i][j] == '#'){
                haveBlack = false;
                for(int x = 0; x < 4; x++){
                    if(square[i + dx[x]][j + dy[x]] == '#'){
                        haveBlack = true;
                        break;
                    }
                }
                if(haveBlack == false) break;
            }
            if(haveBlack == false) break;
        }
        if(haveBlack == false) break;
    }
    
    if(haveBlack == true) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main(){
    
    string s,t;cin>>s>>t;
    ll cnt=0;
    for(int i=0;i<s.length();i++){
        if(s[i]!=t[i]){
            cnt++;
        }
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 3832
import Data.IORef
import Control.Monad
 
main :: IO()
main = getLine >> getContents >>= (\(x:y:xs) -> solve (y - x) (min x y) xs).map read.lines >>= print
 
solve :: Int -> Int -> [Int] -> IO Int
solve a b xs = do
                a' <- newIORef a
                b' <- newIORef b
                forM_ xs $ \z -> do
                    x <- readIORef a'
                    y <- readIORef b'
                    when (z - y > x) $ writeIORef a' (z - y)
                    when (z < y)     $ writeIORef b' z
                readIORef a'

Measured memory_bytes: 5520
#include<iostream>
using namespace std;
int main()
{
	int n,t[100001];
	cin>>n;
	for(int i=1;i<=n;i++)
	cin>>t[i];
	int m;
	cin>>m;
	int k,p;
	for(int i=1;i<=m;i++)
	{
		int ans=0;
		cin>>k>>p;
		ans+=p;
		for(int j=1;j<=n;j++)
		{
			if(j!=k)
			ans+=t[j];
		}
		
		cout<<ans<<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000000;
constexpr ll INF= 1000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<int,int> P;

template<typename T>
T Pow(T a,T b) {
    T ret = 1;
    for(int i = 0;i < b;i++) {
        ret *= a;
    }
    return ret;
}
 
ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}
 
ll RS(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P < 0) {
        return 0;
    }
    if(P%2==0){
        ll t = RS(N, P/2, M);
        return t*t % M;
    }
    return N * RS(N, P-1, M) % M;
}

bool shaffle2(int a,int b,int c,int d) {
    if(a == 0 && b == 1 && c == 2) {
        return false;
    }
    if(a == 0 && b == 2 && c == 1 && d == 0) {
        return false;
    }
    if(a == 1 && b == 0 && c == 2 && d == 0) {
        return false;
    }
    return true;
}

bool shaffle(int a,int b,int c,int d) {
    if((!shaffle2(a,b,c,0)) || (!shaffle2(b,c,d,0))) {
        return false;
    }
    swap(a,b);
    if((!shaffle2(a,b,c,1)) || (!shaffle2(b,c,d,1))) {
        return false;
    }
    swap(a,b);
    swap(b,c);
    if((!shaffle2(a,b,c,1)) || (!shaffle2(b,c,d,1))) {
        return false;
    }
    swap(b,c);
    swap(c,d);
    if((!shaffle2(a,b,c,1)) || (!shaffle2(b,c,d,1))) {
        return false;
    }
    swap(c,d);
    return true;
}

ll dp[110][4][4][4]; //dp[i][j][k][l] = i文字目まで見たときに条件を満たす通り数、ただしj,k,lは0のときA、1のときG、2のときC、3のときT

int main() {
    int N;
    cin >> N;
    for(int i = 0;i < 4;i++) {
        for(int j = 0;j < 4;j++) {
            for(int k = 0;k < 4;k++) {
                dp[3][i][j][k] = 1;
            }
        }
    }
    dp[3][0][1][2] = 0;
    dp[3][0][2][1] = 0;
    dp[3][1][0][2] = 0;
    for(int i = 3;i < N;i++) {
        for(int j = 0;j < 4;j++) {
            for(int k = 0;k < 4;k++) {
                for(int l = 0;l < 4;l++) {
                    for(int m = 0;m < 4;m++) {
                        if(shaffle(j,k,l,m)) {
                            dp[i + 1][k][l][m] += dp[i][j][k][l];
                            dp[i + 1][k][l][m] %= MOD;
                        }
                    }
                }
            }
        }
    }
    ll ret = 0;
    for(int i = 0;i < 4;i++) {
        for(int j = 0;j < 4;j++) {
            for(int k = 0;k < 4;k++) {
                ret += dp[N][i][j][k];
                ret %= MOD;
            }
        }
    }
    cout << ret << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();

    //if(a instanceof int && b instanceof int) {
      if(a <= 1000 && a >= -1000 && b <= 1000 && b >= -1000) {
        int plus = a + b;
        int minus = a - b;
        int kake = a * b;

        if(minus > plus) {
          if(minus > kake) {
            System.out.print(minus);
          } else {
            System.out.print(kake);
          }
        } else {
          if(plus > kake) {
            System.out.print(plus);
          } else {
            System.out.print(kake);
          }
        }
      } else {
        return;
      }
    //} else {
    //  return;
    //}

    sc.close();
  }
}

Measured memory_bytes: 22996
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

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

using namespace std;

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

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

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

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

    int n;
    cin >> n;
    LL a[SIZE], b[SIZE];
    for( int i = 0; i < n + 1; ++i ) cin >> a[i];
    for( int i = 0; i < n; ++i ) cin >> b[i];

    LL res = 0;
    for( int i = 0; i < n; ++i ) {
        if( a[i] <= b[i] ) {
            res += a[i];
            b[i] -= a[i];
            res += min( b[i], a[i + 1] );
            a[i + 1] -= min( b[i], a[i + 1] );

        } else {
            res += b[i];

        }
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define PI 3.1415926535
#define pb(a) push_back(a)
#define mp make_pair
#define sortv(a) sort(a.begin(),a.end())
#define sorta(a,n) sort(a,a+n)
#define fileio freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
using namespace std;
const int INF = 0x3f3f3f3f;
int main()
{
//lets do it
	ll n,x,t;
	cin>>n>>x>>t;
	ll val = n/x;
	ll time1=val*t;
//	ll rem = n%x;
	if(n%x !=0)
	cout<<time1+t<<endl;
	else{
		cout<<time1<<endl;
	}
return(0);
}


Measured memory_bytes: 3632