akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
import static java.util.Arrays.*;
public class Main {

	public static void main(String[] args) {
		while (read()) {
			solve();
		}
	}
	
	static Scanner sc = new Scanner(System.in);
	static int N, M;
	static int[] is;
	static char[] cs;
	static int[][] field = new int[21][21];

	static boolean read() {
		M = sc.nextInt();
		if (M == 0) return false;
		for (int i = 0; i <= 20; i++) fill(field[i], 0);
		for (int i = 0; i < M; i++) {
			int x = sc.nextInt(), y = sc.nextInt();
			field[y][x] = 1;
		}
		
		N = sc.nextInt();
		is = new int[N];
		cs = new char[N];
		for (int i = 0; i < N; i++) {
			cs[i] = sc.next().charAt(0);
			is[i] = sc.nextInt();
		}
		return true;
	}
	
	//					  N    S    W    E
	static int[] dx  = {  0,   0,  -1,   1},
				 dy  = {  1,  -1,   0,   0};
	static void solve() {
		int x = 10, y = 10, gem = 0;
		for (int i = 0; i < N; i++) {
			int k = 0, d = is[i];
			if     (cs[i] == 'N') k = 0;
			else if(cs[i] == 'S') k = 1;
			else if(cs[i] == 'W') k = 2;
			else if(cs[i] == 'E') k = 3;
			
			for (int j = 0; j < d; j++) {
				x += dx[k]; y += dy[k];
				if (field[y][x] == 1) {
					gem++;
					field[y][x] = 0;
				}
			}
		}
		
		if (gem == M) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

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

int main()
{
    int x;
    cin >> x;
    int count = 0;
    int flag = 1;
    int sum = 0;
    while (flag) {
        count++;
        sum = (x + sum) % 360;
        //cout << sum << endl;
        if (sum == 0)
            break;
    }
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 3620
import sys
from math import sqrt
from collections import Counter, defaultdict, deque

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    abcd = input().rstrip()

    op = [""] * 3
    for i in range(2 ** 3):
        r = int(abcd[0])
        for j in range(3):
            if (i >> j) & 1:
                r += int(abcd[j + 1])
                op[j] = "+"
            else:
                r -= int(abcd[j + 1])
                op[j] = "-"
        if r == 7:
            ans = abcd[0]
            for j in range(3):
                ans += op[j] + abcd[j + 1]
            ans += "=7"
            print(ans)
            exit()


if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define FOR(i,n) for(size_t i=0;i<(n);i++)
#define REP(n) FOR(i,n)
#define cinv(v,n) for(size_t i=0;i<(n);i++){cin>>(v)[i];}
#define nvec(type,v,n) vector<type> v(n);cinv(v,n)
#define npairs(type1,type2,v,n) vector<pair<type1,type2>> v(n);for(size_t i=0;i<(n);i++){cin>>v[i].first>>v[i].second;}
#define npairs(type1,type2,v,n) vector<pair<type1,type2>> v(n);for(size_t i=0;i<(n);i++){cin>>v[i].first>>v[i].second;}
#define ntuples(type1,type2,type3,v,n) vector<tuple<type1,type2,type3>> v(n);for(size_t i=0;i<(n);i++){cin>>get<0>(v[i])>>get<1>(v[i])>>get<2>(v[i]);}

#define min_index(v) size_t(min_element(all(v))-(v).begin())
#define max_index(v) size_t(max_element(all(v))-(v).begin())
#define min_e(v) *min_element(all(v))
#define max_e(v) *max_element(all(v))

#define count_le(v,a) size_t(upper_bound(all(v),a)-(v).begin())
#define count_lt(v,a) size_t(lower_bound(all(v),a)-(v).begin())
#define count_ge(v,a) size_t((v).end()-lower_bound(all(v),a))
#define count_gt(v,a) size_t((v).end()-upper_bound(all(v),a))

#define order(neq_sl) [](const auto s, const auto l){return neq_sl;}
#define make_lr(v,type,l,r) vector<type> l(n+1),r(n+1);FOR(i,n){l[i+1]=l[i]+v[i];r[i+1]=r[i]+v[n-1-i];}

#define acm accumulate
#define SUM(v) accumulate(all(v),0l)


int main() {
  int n;
  string s,t;
  cin>>n>>s>>t;
  for(int i=0;i<n;i++){
    cout<<s[i]<<t[i];
  }
}

Measured memory_bytes: 256
n = int(input())
s = input()
c = [0] * len(s)
o = s[0]
ans = []
for i in range(1, len(s)):
    if s[i] == o:
        c[i] = 1
    else:
        o = s[i]
for i in range(len(s)):
    if c[i] == 0:
        ans.append(s[i])
print(len("".join(ans)))

Measured memory_bytes: 4724
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const int MAX = 510000;

// vectorの要素を検索
bool vector_exist(vector<ll> vec, ll number) {
  auto itr = find(vec.begin(), vec.end(), number);
  size_t index = distance(vec.begin(), itr);
  if (index!=vec.size()) {
    return true;
  }
  else {
    return false;
  }
}

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (ll i=0; i<N; i++) cin >> A[i];
  ll minus = 0; // 負の数の個数
  for (ll i=0; i<N; i++) {
    if (A[i]<0) minus++;
  }
  ll res = 0;
  if (minus%2==0||vector_exist(A, 0)) {
    for (ll i=0; i<N; i++) res += abs(A[i]);
  }
  else {
    for (ll i=0; i<N; i++) res += abs(A[i]);
    for (ll i=0; i<N; i++) A[i] = abs(A[i]);
    sort(A.begin(), A.end());
    res -= 2*A[0];
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) 
#define ll long long 
#define int long long 
#define vll vector<long long>
#define pii pair<long long ,long long > 
#define vvi vector< vector<long long > > 
#define vpii vector<pair<int,int>> 
#define pll  pair<long long ,long long > 
#define pb  push_back
#define ff  first 
#define sec second  
#define SORT(a) sort(a.begin(),a.end())
#define SORTR(a) sort(a.rbegin(),a.rend()) 
#define m_p make_pair
#define all(x) (x.begin(),x.end()) 
#define sz(v) ((int)(v.size()))
#define endl '\n'
typedef vector< long long > vi ;
const int MOD=1e9 +7 ;
int size=10000000; 
 
int32_t main(){
  fast; /*
  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif*/ 
  
  int T=1; //cin>>T; 
  while(T--){


    int n; cin>>n; int w ; cin>>w; 
    vpii v(n); 
    
    for(int i=0;i<n;i++){
      int x,y; 
      cin>>x>>y; 
      v[i]={x,y};
    }

    vi dp(w+1,-1); 
    dp[0]=0; 
    for(int i=0; i<n; i++ ){
        for( int j=w-1;j>=0;j--){
          
          if(dp[j]!=-1){ 

            if(j+v[i].ff<=w){
              if(dp[j+v[i].ff]!=-1) dp[j+v[i].ff]=max(dp[j+v[i].ff],v[i].sec+dp[j]); 
              else dp[j+v[i].ff]=v[i].sec+dp[j];  
            }

          }
        }

    //debug(dp);

    }
    int mx=INT_MIN; 
    for(int i=1;i<=w;i++) mx=max(mx,dp[i]); 
    cout<<mx<<endl; 

  }
    


  return 0; 
} 

Measured memory_bytes: 1024
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <functional>
#include <cstdlib>
using namespace std;
#define REP(i,n) for(int i = 0;i < (int)(n);i++)

int main() {
	int n,red=0,blue=0;
	string s;
	cin >> s;
	n = s.size();
	REP(i, n) {
		if (s[i] == '0') {
			red++;
		}
		else {
			blue++;
		}
	}
	cout << min(red, blue) * 2;
	return(0);
}

Measured memory_bytes: 512
#include<stdio.h>
int main(void)
{
	int i,N,a[200002],A,min;
	
	scanf("%d",&N);
	
	for(i=0;i<N;i++)
	{
		scanf("%d",&a[i]);
	}
	
	min=a[0];
	A = a[1]-a[0];
	
	for(i=1;i<N;i++)
	{
		if(a[i]<min)
		{
			min =a[i];
		}
		else if(a[i]-min>A)
		{
			A = a[i]-min;
		}
	}
	
	printf("%d\n",A);

	return 0;
}	


Measured memory_bytes: 2548
#include <iostream>
#include <vector>
#include <stdio.h>
#include <cmath>
using namespace std;

int gcd(int x, int y){
    int r;
    r = 10;
    while(r != 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
}

int main(){
    int x, y, out_;
    scanf("%d %d",&x,&y);
    if(x < y){
        swap(x,y);
    }
    out_ = gcd(x, y);
    printf("%d\n", out_);
}



// #include <stdio.h>

// int calc(int x,int y){
// 	if(y == 0){
// 		return x;
// 	}else{
// 		return calc(y,x%y);
// 	}
// }

// int main(){
// 	int x,y;
// 	scanf("%d %d",&x,&y);
// 	if(x >= y)
// 		printf("%d\n",calc(x,y));
// 	else{
// 		printf("%d\n",calc(y,x));
// 	}
// }


Measured memory_bytes: 3212
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<math.h>
#include<iomanip>
#include<functional>
using namespace std;

#define ll long long
using vt = ll; //ここで数値の型を変えられる
#define rep(i, n) for (vt i = 0; i < (vt)(n); i++)
#define reps(i, s, n) for(vt i = (vt) (s); i < (vt) (n); i++) 
#define all(v) v.begin(), v.end()
#define P pair<ll, ll>
const ll  MOD = 1000000007;

int main() {
	int x, y, z;
	cin >> x >> y >> z;
	swap(x, y);
	swap(x, z);
	cout << x << " " << y << " " << z;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    ll ans = n;
    ll sm  = 0;
    for(int i=0;i<n-1;i++){
        sm += a[i];
        if(a[i+1]>2*sm){
            ans = n-(i+1);
        }
    }
    cout << ans << endl;
}

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

int main(){
    ll N, M;
    cin >> N >> M;
    ll p = pow(2, M);
    ll t = 1900*M+100*(N-M);
    cout << p*t << endl;
}


Measured memory_bytes: 4060
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>
#include<iomanip>//小数点以下を精度良く表示

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define INF 2000000000
#define INF2 1000000000000000000
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<string, string> P;
const ll MOD=1000000007;
using Graph = vector<vector<int>>;


template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
int up(int a, int b) {
    return (a + a % b) / b;
}

int main(){
    string s;
    cin >> s;
    vector<char> a;
    //cout << s.length();
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == '0') a.push_back('0');
        else if (s[i] == '1') a.push_back('1');
        else if (s[i] == 'B' && a.size()) a.pop_back();
    }
    int j = 0;
    //cout << 1 << endl;
    for (auto i = a.begin(); i < a.end(); i++) {
        
        cout << a[j];
        j++;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		for(int i=s.length()-2; i>=1; i-=2){
			if(s.substring(0, i/2).equals(s.substring(i/2,i))){
				System.out.println(i);
				break;
			}
		}
	}
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define FOR(i, s, n) for(int i=(int)(s); i<(int)(n); ++i)
#define ALL(n) (n).begin(), (n).end()
#define pb push_back

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> mat;

const ll MAX_V = 100000;
const ll INF = 1e9;
const ll MOD = 998244353;

int main(){
    int n; cin >> n;
    cout << ((1 + n) * n / 2) << endl;
}

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

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

  if(n%10==3){
    cout << "bon" << endl;
  }else if(n%10==0 || n%10==1 || n%10==6 ||n%10==8){
    cout << "pon" << endl;
  }else{
    cout << "hon" << endl;
  }
}

Measured memory_bytes: 3592
import java.util.*;
public class Main {
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        int L [][] = new int[8][8];
        int k = sc.nextInt();
        for(int i=0;i<8;i++)Arrays.fill(L[i],0);
        for(int i=0;i<k;i++)Check(L,sc.nextInt(),sc.nextInt());
        //探索
        whole:for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                int [][] L2 = deep_copy(L);
                L2=Find(L2,i,j);
                if(check(L2)==8) {
                    L = L2;
                    break whole;
                }
            }
        }
        for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                if(L[i][j]==2)System.out.print("Q");
                else System.out.print(".");
            }
            System.out.println();
        }
    }
    //探索関数
    public static int[][] Find(int L[][],int r,int c){
        if(check(L)==8)return L;
        int [][] L2 = new int[8][8];
        whole:for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                if(L[i][j]==0){
                    Check(L,r,c);
                    L2 = deep_copy(L);
                    L2 = Find(L2,i,j);
                    if(check(L2)==8) break whole;
                }
            }
        }
        return L2;
    }
    //縦横斜めのチェックをする関数
    public static void Check(int L[][],int r,int c){
        L[r][c]=2;
        for(int i=1;i<=7;i++){
            if(r-i>=0)L[r-i][c]=1;
            if(r+i<8)L[r+i][c]=1;
            if(c-i>=0)L[r][c-i]=1;
            if(c+i<8)L[r][c+i]=1;
            if(r+i<8&&c+i<8)L[r+i][c+i]=1;
            if(r-i>=0&&c-i>=0)L[r-i][c-i]=1;
            if(r+i<8&&c-i>=0)L[r+i][c-i]=1;
            if(r-i>=0&&c+i<8)L[r-i][c+i]=1;
        }
    }
    public static int [][] deep_copy(int L[][]){
        int L2 [][] = new int[8][8];
        for(int i=0;i<8;i++)for(int j=0;j<8;j++) L2[i][j] = L [i][j];
        return L2;
    }
    public static int check(int L[][]){
        int num = 0;
        for(int i=0;i<8;i++)for(int j=0;j<8;j++)if(L[i][j]==2)num++;
        return num;
    }
}


Measured memory_bytes: 56868
#include<stdio.h>

int main()
{
	int input,a,b;
	scanf("%d",&input);
	if(input>=0 && input>=25) {
		a = input/25;
		b += a;
		input -=a*25;
	}
	if(input>=0 && input >= 10){
		a=input/10;
		b += a;	
		input -= a*10;
	}
	if(input>=0 && input >= 5){
		a=input/5;
		b += a;	
		input -= a*5;
	}
	b+=input;
	printf("%d\n",b);
}


Measured memory_bytes: 2148
#include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main() {
	int a,b; cin>>a>>b;
	cout<<a*b<<endl;


	return 0;
}


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

using namespace std;
using ll = long long;
using ld = long double;

const int MOD = 1e9 + 7;
const int MX = 2e5 + 5;
const ll INF = 1e18;
const ld PI = acos((ld) -1);

int main () {
	int n, x, t;
	cin >> n >> x >> t;
	cout << (n/x + (n % x != 0)) * t << '\n';
}


Measured memory_bytes: 3592
#include<iostream>
using namespace std;
int main(void){
  int a,b;
  cin>>a>>b;
  int v,w,x,y,z;
  int c(0);
  for(int i(a);i<=b;i++){
    int t=i;
    v=t/10000;
    t%=10000;
    w=t/1000;
    t%=1000;
    x=t/100;
    t%=100;
    y=t/10;
    t%=10;
    z=t;
    if(v==z && w==y)c++;
  }
  cout<<c<<endl;
  return 0;
}

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

const int MAX_N = 21;

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

  int V[MAX_N];
  int C[MAX_N];
  for (int i = 0; i < N ; i++) cin >> V[i];
  for (int i = 0; i < N ; i++) cin >> C[i];
  

  int sum = 0;
  for (int i = 0; i < N; i++) {
    int k = V[i] - C[i];
    if (k > 0) sum += k;
  }
  cout << sum << endl;
}


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

#define ll long long
#define inf 0x3f3f3f3f
const int maxn=1e5+5;
#define mod 1000000007
/*int head[maxn],ver[maxn],nxt[maxn],tot,edge[maxn];
bool vis[maxn];
int d[maxn],ans;
void add(int x,int y)
{
    ver[++tot]=y;
    edge[tot]=1;
    nxt[tot]=head[x];
    head[x]=tot;
}
void dp(int x)
{
    vis[x]=1;
    for(int i=head[x];i;i=nxt[i])
    {
        int y=ver[i];
        if(vis[y])continue;
        dp(y);
        ans=max(ans,d[x]+d[y]+edge[i]);
        d[x]=max(d[x],d[y]+edge[i]);
    }
}*/
int main()
{
   int h,a,t;
   ll sum=0;
   cin>>h>>a;
   for(int i=1;i<=a;i++)
   {
       cin>>t;
       sum+=t;
   }
   if(sum>=h)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(Array) sort(Array.begin(), Array.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define out(ans) cout << ans << endl;
const int MOD = 1000000007;
const int INF = 2147483647;
const ld PI = 3.14159265358979323846;

//------------↓------------- M -------------- E ---------------- M --------------- O ---------------↓--------------//
// コンパイル 
// g++ -std=c++1z
//
// -------型変換--------
// int を string に変換
// string s = to_string(n);
// string を int に変換
// int n = stoi(s);
//
// -------二分探索---------
// k以上の値が最初に現れる時のイテレータ
// lower_bound(data.begin(), data.end(), k)
// kより大きい値が最初の現れる時のイテレータ O(logN)
// upper_bound(data.begin(), data.end(), k)
// kがdataに存在するかをtrue or falseで返す O(logN)
// binary_search(data.begin(), data.end(), k)
// 
//
//
//
//
//
// 
//------------↑------------- M -------------- E ---------------- M --------------- O ---------------↑--------------//







int main(void) {


    ld a, b, x; cin >> a >> b >> x;
    ld w = x / a;
    ld theta;
    if (a * b / 2 > w) {
        theta = atan(b / (w * 2 / b));
    }
    else {
        theta = atan(2 * (a * b - w) / a / a);
    }
    theta = theta / (2 * PI) * 360;
    printf("%.12Lf", theta);

    return 0;
}











Measured memory_bytes: 1020
#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	if (n % 10 == 3)
		cout << "bon";
	else if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8)
		cout << "pon";
	else
		cout << "hon";
    return 0;
}



Measured memory_bytes: 3616
/*                        ______
 _______   /\     |``\   |        |  /
    |     /  \    |__/   |____    |/
    |    / _ _\   |  \   |        |\
    |   /      \  |   \  |______  |  \

            Dept. of CSE
        Comilla  University

*/
#include<bits/stdc++.h>
#define pi 2*acos(0.0)
#define ll long long
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Node struct node
#define spc " "
#define  E  2.71828182845904523536
#define pb push_back
#define pp pop_back
#define valid(nx,ny) nx>=0 && nx<n && ny>=0 && ny<m
#define ee endl
#define pii pair<int,int>
#define infinity 10000000000000000
#define mod 1000000007
int fx[]={0,0,+1,-1};
int fy[]={+1,-1,0,0};

using namespace std;
///check n=1;
///check corner case;
const int maX=1e5+1;
vector<ll>Graph[maX],cost[maX];
ll visit[maX];
ll x[10];
ll y[10];
double dist(ll i, ll j)
{
    double dx=x[i]-x[j];
    double dy=y[i]-y[j];
    return pow(dx*dx+dy*dy,0.5);
}

int main()
{
   ll n,i,j,cc=0,sum=0;
   cin>>n;
   ll ara[n],bal[n-1];
   for(i=0;i<n-1;i++)cin>>bal[i];
   bal[n-1]=1000000000000LL;
   for(i=0;i<n-1;i++){
       if(i==0){
          if(bal[0]>bal[1]){
            cc+=bal[0];
            cc+=bal[1];
          }
          else cc+=2*bal[0];

       }
       else{
        ll x=min(bal[i],bal[i+1]);
            cc+=x;
       }
   }
  cout<<cc<<endl;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

ll power(ll n, ll k);
ll inv(ll n);
ll genfact(ll n, ll k);
ll fact(ll n);
ll nck(ll n, ll k);

int main(void){
  int x, a, b;
  cin >> x >> a >> b;

  cout << (x - a) % b << endl;

  return 0;
}


ll power(ll n, ll k){
  ll res = 1;
  while(k > 0){
    if (k & 1) 
      res = res * n % MOD;
    n = n * n % MOD;
    k >>= 1;
  }
  return res;
}

ll genfact(ll n, ll k){

  ll res = 1;
  while (k >= 0){
    res = (res * (n - k)) % MOD;
    k--;
  }

  return res;
}

ll inv(ll n){
  return power(n, MOD - 2);
}

ll fact(ll n){
  return genfact(n, n - 1);
}

ll nck(ll n, ll k){
  if (k == 0)
    return 1;
  if (n <= 0)
    return 0;

  return ((genfact(n, k) % MOD) * inv(fact(k))) % MOD;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;

int N; vector<int> con[202020];
int d1[202020], dn[202020], c1, cn;
int chk[202020];

void dfs(int ix, int v, int* k){
	chk[ix]=1, k[ix]=v;
	for(auto e : con[ix]){
		if(!chk[e]) dfs(e, v+1, k);
	}
}

int main(){
	scanf("%d", &N);
	for(int i=1; i<N; i++){
		int s, e;
		scanf("%d%d", &s, &e);
		con[s].push_back(e); con[e].push_back(s);
	}
	dfs(1, 0, d1);
	memset(chk, 0, sizeof(chk)); dfs(N, 0, dn);
	for(int i=1; i<=N; i++){
		if(d1[i] <= dn[i]) c1++;
		else cn++;
	}
	if(c1 <= cn) puts("Snuke");
	else puts("Fennec");
	return 0;
}


Measured memory_bytes: 14720
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto R = RD;

	writeln(R < 1200 ? "ABC" : R < 2800 ? "ARC" : "AGC");
	stdout.flush();
	debug readln();
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<cmath>
#include<limits>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define pint_INF 2000000000
#define ll_INF 	9223372036854775807
#define MOD 1000000007
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define sysp system("PAUSE")
using namespace std;
#define int ll

struct Waiting{
    int num = 0;
    int minutes = -1;
};

signed main(){
    int N,C,K; cin >> N >> C >> K;
    vi passengers(N); rep(i,N) cin >> passengers[i]; 
    sort(ALL(passengers));
    Waiting que;
    int bus = 0;
    que.num++;
    que.minutes = 0;
    for(int i = 1; i < N; i++){
        if(que.num == C){
            //Bus leaving
            bus++;
            que.num = 1;
            que.minutes = 0;
        }else if(que.minutes + (passengers[i] - passengers[i-1]) > K){
            // bus leaving
            bus++;
            que.num = 1;
            que.minutes = 0;
            
        }else{
            que.num++;
            que.minutes += passengers[i] - passengers[i-1];
        }


    }
    bus++;
    cout << bus << endl;
    sysp;
}

Measured memory_bytes: 1272
#include<bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;
#define ll long long int
#define ld long long double
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pl pair<ll, ll>
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define nl '\n'
#define mp make_pair
#define debug1(x) cout <<#x<<" "<<x<<'\n';
#define debug2(x,y) cout <<#x<<" "<<x <<" "<<#y<<" "<<y <<'\n';
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<'\n';
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define inf 1e18
const int mod = (int)1e9 + 7;
pair<ll, ll>s4[4] = {{ -1, 0}, {1, 0}, {0, -1}, {0, 1}};
pair<ll, ll>s8[8] = {{ -1, -1}, { -1, 0}, { -1, 1}, {0, -1}, {0, 1}, {1, 1}, {1, 0}, {1, -1}};

void judge() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

void solve() {
	int n;
	cin >> n;
	int ans = 0;
	int a[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		ans = ans ^ a[i];
	}
	for (int i = 0; i < n; i++) {
		cout << (ans ^ a[i]) << " ";
	}
}

signed main() {
	judge();
	boost;
	solve();
}


Measured memory_bytes: 4364
#include <bits/stdc++.h>
#define fastcin ios_base::sync_with_stdio(0);cin.tie(0)
#define int long long
#define pb push_back
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<long long>
#define vb vector<bool>
#define all(c) c.begin(),c.end()
#define i(a,b) for( int i = a ; i < b ; ++i)
#define j(a,b) for( int j = a ; j < b ; ++j)
#define k(a,b) for( int k = a ; k < b ; ++k)            
#define ri(a,b) for( int i = a ; i >= b ; --i)
#define rj(a,b) for( int j = a ; j >= b ; --j)
#define ar cout << "ok" << endl
#define vvi(a,b,c,d)  vector<vector<int> >a(b,vector<int>(c,d))
#define sz(c) (int)(c).size()

using namespace std;
int o = 0; 

void replace( string &s, string t, string r ) {
    string::size_type p = 0;
    while ( ( p = s.find( t, p ) ) != string::npos ) {
        s.replace( p, t.length(), r );
        p += r.length();
    }
}

long long binpow(long long a, long long b ,int mod = 1000000007 ) {
    if (b == 0)
        return 1;
    long long res = binpow(a, b / 2,mod);
    if (b % 2)
        return (((res%mod) * (res%mod))%mod * (a%mod))%mod;
    else
        return ((res%mod) * (res%mod))%mod;
}
int modInverse(int n, int p) 
{ 
    return binpow(n, p-2, p); 
} 
int nCrModPFermat(int n, int r, int p) 
{ 
   if (r==0) 
      return 1; 
    int fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* modInverse(fac[r], p) % p * 
            modInverse(fac[n-r], p) % p) % p; 
}

void solve(){
	int m , d ,ans=0;
	cin >> m >> d;
	i(22,d+1){
		if(i/10 <= 1 || i%10 <= 1) continue;
		if((i/10)*(i%10) <= m)
			ans++;
	}	
	cout << ans << endl;
}	

int32_t main(){
    fastcin;
    int q =1;
    //cin >> q;
    while(q--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>

long long res[2001][2001];

const int mod = 1000000007;
int main() {
	int N, M;
	scanf("%d %d", &N, &M);
	int *S = new int[N];
	int *T = new int[M];
	for (int i = 0; i < N; i++) {
		scanf("%d", &S[i]);
	}
	for (int i = 0; i < M; i++) {
		scanf("%d", &T[i]);
	}
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= M; j++) {
			res[i][j] = 1;
		}
	}
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= M; j++) {
			if (S[i - 1] == T[j - 1]) {
				res[i][j] = (res[i - 1][j] + res[i][j - 1]) % mod;
			}
			else {
				res[i][j] = (res[i - 1][j] + res[i][j - 1] - res[i - 1][j - 1] + mod) % mod;
			}
		}
	}
	printf("%d", res[N][M]);
}





Measured memory_bytes: 31488
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define FOR(a,b,c) for(int a = (b); a <= (c); a++)
#define RFOR(a,b,c) for(int a = (b); a >= (c); a--)
#define all(x) (x).begin(), (x).end()
#define vi vector <int>
#define vvi vector <vi>
#define ll long long
#define vll vector <ll>
#define vvl vector <vll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define ep emplace
#define fs first
#define sd second
#define mod 998244353
#define EPS 1e-9
#define tc int t; cin >> t; while(t--)
using namespace std;

int main() {
	FIO;
	int n, a, b; cin >> n >> a >> b;
	FOR(i, a, b) {
		if (i % n) continue;
		cout << "OK\n";
		return 0;
	}
	cout << "NG\n";
	return 0;
}

Measured memory_bytes: 3652
from collections import deque

inf = float('inf')

n, m = map(int, input().split())

es = [[] for _ in range(n * 3)]
for _ in range(m):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    es[u].append(v + n)
    es[u + n].append(v + n * 2)
    es[u + n * 2].append(v)

s, t = map(int, input().split())
s -= 1
t -= 1

dq = deque()
dq.append(s)

can = False
dist = [inf] * (n * 3)
dist[s] = 0

while dq:
    v = dq.popleft()
    if v == t:
        can = True
        break
    for nv in es[v]:
        if dist[nv] == inf:
            dq.append(nv)
            dist[nv] = dist[v] + 1

if not can:
    print(-1)
else:
    print(dist[t] // 3)


Measured memory_bytes: 60112
n = gets.chomp.to_i
ans = 0
t = Array.new(100001,99999)
t[0] = 0
db = []
(0..10).each do |d|
  db.push(6**d)
  db.push(9**d)
end
db = db.sort
db.each do |d|
  (0..100000).each do |i|
    t[i+d] = [t[i+d],t[i]+1].min if(i+d <= 100000)
  end
end
p t[n]

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

using namespace std;

#define INF (1ll << 62)
#define pb push_back
#define ii pair<int,int>
#define OK cerr <<"OK"<< endl
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int>
#define endl '\n'

int check(int k, int a, int b) {
	return (abs(a - k) == abs(b - k));
}

signed main () {
  
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int a, b;

  cin >> a >> b;

  int k;

  k = (a + b) / 2;

  if(check(k, a, b)) {
  	cout << k << endl;
  	return 0;
  }

  k = (b + a) / 2;

  if(check(k , a, b)) {
  	cout << k << endl;
  	return 0;
  }

  if(a == b) {
  	cout << 0 << endl;
  	return 0;
  }

  cout << "IMPOSSIBLE" << endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));

int main() {

	int h1, w1, h2, w2;
	cin >> h1 >> w1 >> h2 >> w2;

	cout << (h1 - h2) * (w1 - w2) << endl;

	return 0;
}

Measured memory_bytes: 256
-- Getting Started - Maximum Profit

import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
  n <- readLn
  xs <- map read <$> replicateM n getLine
  print $ maximumProfit xs

maximumProfit :: [Int] -> Int
maximumProfit xs = maximum $ zipWith (-) (tail xs) (findMin xs)

findMin :: [Int] -> [Int]
findMin (x : xs) = x : loop x xs
  where
    loop _ [] = []
    loop m (x : xs)
      | m < x     = m : loop m xs
      | otherwise = x : loop x xs



Measured memory_bytes: 132156
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

std::vector<std::pair<int64_t, int64_t>> FactorizeIntoPrimeFactors(const int64_t N) {
  std::vector<std::pair<int64_t, int64_t>> result;
  if (N <= 0LL || N == 1LL) {
    return result;
  }
  int64_t remaining = N;
  for (int64_t i = 2LL; i * i <= remaining; ++i) {
    int64_t count = 0LL;
    while (remaining % i == 0LL) {
      ++count;
      remaining /= i;
    }
    if (count > 0LL) {
      result.push_back(std::pair<int64_t, int64_t>(i, count));
    }
  }
  if (remaining > 1) {
    result.push_back(std::pair<int64_t, int64_t>(remaining, 1));
  }
  return result;
}

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

  int64_t N;
  cin >> N;
  cout << N << ":";
  std::vector<std::pair<int64_t, int64_t>> result = FactorizeIntoPrimeFactors(N);
  for (const auto p : result) {
    for (int32_t i = 0; i < p.second; ++i) {
      cout << " " << p.first;
    }
  }
  cout << endl;

  return 0;
}



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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

const int BIT_MAX = 200010;

template <class T> class BIT{
	T x[BIT_MAX + 1];
	
public:
	
	BIT(){
		fill(x,x+BIT_MAX+1,0);
	}
	
	void add(int a , T b){
		++a;
		for(; a <= BIT_MAX ; a += a & -a) x[a] += b;
	}
	
	T get(int a){
		++a;
		T b = 0;
		for(; a > 0 ; a -= a & -a) b += x[a];
		return b;
	}
};

const int CM = 200010;
int N,K;
int a[CM];
LL s[CM];
int c[CM];
int r[CM];
BIT<int> bit;
LL p;

bool eval(int z){
	return s[c[z]] >= p;
}

int BS(int x , int y){
	if(x-y<2) return x;
	int z = (x+y)/2;
	return eval(z) ? BS(z,y) : BS(x,z);
}

int main(){
	scanf("%d%d" , &N , &K);
	repp(i,0,N){
		scanf("%d" , a + i);
		s[i] = a[i] + (i == 0 ? (LL)K*(N-1) : s[i-1]-K);
		c[i] = i;
	}
	sort(c,c+N,[&](const int x , const int y){return s[x] < s[y];});
	repp(i,0,N) r[c[i]] = i;
	//repp(i,0,N) printf(" %d %lld\n" , c[i] , s[c[i]]);
	p = (LL)K * N;
	LL ans = 0;
	repp(i,0,N){
		int z = BS(N,-1);
		ans += N-z-bit.get(z);
		bit.add(0,1);
		bit.add(r[i]+1,-1);
		//printf("%lld %d %lld\n" , p , z , ans);
		p -= K - a[i];
	}
	printf("%lld\n" , ans);
	return 0;
}


Measured memory_bytes: 4992
#include<stdio.h>
int main(void)
{
int a,b,area,length = 0;

scanf("%d %d",&a,&b);

if(1<=a && 1<=b && a<=100 && b<=100){

area = a*b;
length = (a+b)*2;

printf("%d %d\n",area,length);

}

return 0;
}

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

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, 0, n) cin >> a[i];
    auto f = [&](bool f) {
        ll res = 0, sum = 0;
        if(f) {
            if(a[0] > 0) sum = a[0];
            else {
                res += 1 - a[0];
                sum = 1;
            }
        } else {
            if(a[0] < 0) sum = a[0];
            else {
                res += a[0] - (-1);
                sum = -1;
            }
        }
        cerr << sum << " ";
        rep(i, 1, n){
            if(sum < 0) {
                if(sum + a[i] > 0) {
                    sum += a[i];
                } else {
                    sum += a[i];
                    res += 1 - sum;
                    sum = 1;
                }
            } else {
                if(sum + a[i] < 0){
                    sum += a[i];
                } else {
                    sum += a[i];
                    res += sum - (-1);
                    sum = -1;
                }
            }
            cerr << sum << " ";
        }
        cerr << endl;
        return res;
    };
    cerr << f(true) << endl;
    cerr << f(false) << endl;
    cout << min(f(true), f(false)) << endl;
    return 0;
}

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

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

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 1000000007; // 998244353;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

void Main(){
    string T; cin >> T;
    int N = T.size();
    REP(i,N){
        if(T[i] == '?') T[i] = 'D';
    }

    cout << T << en;
    return;
}

int main(void){
    cin.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t){
        Main();
    }
    return 0;
}

Measured memory_bytes: 3740
let solve n =
  let paid = n * 800 and
      num_refund = n / 15 in
  let refund = 200 * num_refund in
  paid - refund

let () =
  let rec read () =
    try let ans = (Scanf.scanf "%d\n" solve) in
        Printf.printf "%d\n" ans
    with End_of_file -> ()
  in
  read ()
;;


Measured memory_bytes: 384
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

trait EvenOdd {
    fn is_even(&self) -> bool;
}

impl EvenOdd for u64{
    fn is_even(&self) -> bool {
        return if *self % 2 == 0 {
            true
        }else{
            false
        }
    }
}

use std::cmp;
fn main() {
    input!(a:u64, b:u64, c:u64);
    let mut a = a;
    let mut b = b;
    let mut c = c;
    let mut a2 = 0_u64;
    let mut b2 = 0_u64;
    let mut c2 = 0_u64;
    
    if a == b && b == c && a.is_even(){
        println!("-1");
        return;
    }

    let mut ans = 0_u64;
    loop {
        if a % 2 == 1 || b % 2 == 1 || c % 2 == 1 {
            break;
        }
        ans += 1;
        a2 = a / 2;
        b2 = b / 2;
        c2 = c / 2;
        a=0;
        b=0;
        c=0;
        b += a2;
        c += a2;
        a += b2;
        c += b2;
        a += c2;
        b += c2;
        dbg!(a, b, c);
    }

    println!("{}", ans);
}


Measured memory_bytes: 2128
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  vector<string> s(3);
  for (int k = 0; k < 3; ++k) {
    cin >> s[k];
  }
  int i = 0;
  while (true) {
    if (s[i].size() == 0) break;
    int j = s[i][0] - 'a';
    s[i] = s[i].substr(1);
    i = j;
  }
  cout << (char)('A' + i) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
int main()
{
    ll n, x, t, temp;

    std::cin >> n >> x >> t;
    if (n % x == 0) {
        temp = 0;
    } else {
        temp = 1;
    }
    std::cout << ((n / x) + temp) * t << std::endl;
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;string S[9999],U;int n,a,b,c,d,p[9999][2],i,j;int main(){while(1){cin>>a>>b;if(!a){break;}for(i=0;i<a;i++){cin>>U>>c>>d;S[i]=U;p[i][0]=d-c+1;p[i][1]=d;}for(i=0;i<b;i++){cin>>c;for(j=0;j<a;j++){if(c>=p[j][0]&&c<=p[j][1]){cout<<S[j]<<' '<<c-p[j][0]+1<<endl;goto E;}}printf("Unknown\n");E:;}}}

Measured memory_bytes: 1356
#include<bits/stdc++.h>
using namespace std;
int main()
{

       string s,t;
       cin>>s>>t;
       int l=s.length();
       string temp=t.substr(0,l);
       if(temp==s)
        cout<<"Yes"<<endl;
       else
        cout<<"No"<<endl;

  }





Measured memory_bytes: 3596
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<queue>
#include<bitset>

#define ipair pair<int,int>
#define rep(i,n) for(i=0;i<n;i++)

using namespace std;

typedef long long int lli;
typedef vector<int> vi;

int main() {
	vector< vector<char> >s;
	int h, w, i, j, k;
	vector< vector<bool> >b;

	cin >> h >> w;
	s.resize(h);
	b.resize(h);
	rep(i, h) {
		s[i].resize(w);
		b[i].resize(w);
		rep(j, w) {
			cin >> s[i][j];
			b[i][j] = s[i][j] == '.' ? true : false;
		}
	}
	
	rep(i, h) {
		rep(j, w) {
			if (!b[i][j]) {
				if (i == 0) {
					if (j == 0) {
						if (!(s[0][1] == '#' || s[1][0] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else if (j == w - 1) {
						if (!(s[1][j] == '#' || s[0][j - 1] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else {
						if (!(s[0][j - 1] == '#' || s[1][j] == '#' || s[0][j + 1] == '#')) {
							cout << "No";
							return 0;
						}
					}
				}
				else if (i == h - 1) {
					if (j == 0) {
						if (!(s[i - 1][0] == '#' || s[i][1] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else if (j == w - 1) {
						if (!(s[i - 1][j] == '#' || s[i][j - 1] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else {
						if (!(s[i][j - 1] == '#' || s[i][j + 1] == '#' || s[i - 1][j] == '#')) {
							cout << "No";
							return 0;
						}
					}
				}
				else {
					if (j == 0) {
						if (!(s[i][j + 1] == '#' || s[i - 1][j] == '#' || s[i + 1][j] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else if (j == w - 1) {
						if (!(s[i][j - 1] == '#' || s[i + 1][j] == '#' || s[i - 1][j] == '#')) {
							cout << "No";
							return 0;
						}
					}
					else {
						if (!(s[i][j + 1] == '#' || s[i][j - 1] == '#' || s[i + 1][j] == '#' || s[i - 1][j] == '#')) {
							cout << "No";
							return 0;
						}
					}
				}
			}
		}
	}

	cout << "Yes";

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forin(in, n) for(int i=0; i<n; i++) cin>>in[i]
#define forout(out) for(int i=0; i<(int)out.size(); i++) cout<<out[i]<<endl
#define rep(i, n) for(int i=0; i<(n); i++)

int main(){
    int n; cin>> n;
    vector<ll> h(n);
    int ans=0;
    int cnt=0;
    forin(h, n);
    for(int i=0; i<n-1; i++){
        if(h[i] >= h[i+1]){
            cnt++;
        }else{
            cnt=0;
        }
        ans=max(cnt, ans);
    }
    cout<<ans<<endl;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

typedef vector<string> vs;
typedef vector<vs> vvs;

vs rotate(vs str) {
	vs res(8);
	REP(i, 8) {
		res[i].resize(8);
		REP(j, 8) res[i][j] = str[7 - j][i];
	}
	return res;
}

int main() {
	vs str(8);
	REP(i, 8) cin >> str[i];
	
	vvs ans(4, vs(8));
	ans[0] = str;
	
	FOR(i, 1, 4) ans[i] = rotate(ans[i - 1]);
	
	FOR(i, 1, 4) {
		cout << i * 90 << endl;
		REP(j, 8) cout << ans[i][j] << endl;
	}
	return 0;
}

Measured memory_bytes: 1200