buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n = s.length(); bool ans = true; for (int i = 0; i < n - 1; i++) { if (s[i] != t[i]) { ans = false; } } if (ans) cout << "Yes"; else cout << "No"; cout << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s, t; cin >> s >> t; int n = s.length(); bool ans = true; for (int i = 0; i < n; i++) { if (s[i] != t[i]) { ans = false; } } if (ans) cout << "Yes"; else cout << "No"; cout << "\n"; return 0; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
99
#include <bits/stdc++.h> using namespace std; typedef long long ll; //--<for debugging> #define whatis(x) cout << #x << " is " << x << " "; #define whatisl(x) cout << #x << " is " << x << "\n"; #define parr(array, end) \ for (ll loop = 0; loop < end; loop++) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //--<for debugging> #define whatis(x) cout << #x << " is " << x << " "; #define whatisl(x) cout << #x << " is " << x << "\n"; #define parr(array, end) \ for (ll loop = 0; loop < end; loop++) ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
213
#include <bits/stdc++.h> using namespace std; #define maxn 10010 typedef long long ll; typedef long double ld; const int MINI INT_MIN; const ll MINL LLONG_MIN; int main() { ios_base::sync_with_stdio(0); string s, t; cin >> s >> t; bool ck = true; for (int i = 0; i < s.length(); i++) { if (s[i] != t[i]) {...
#include <bits/stdc++.h> using namespace std; #define maxn 10010 typedef long long ll; typedef long double ld; const int MINI INT_MIN; const ll MINL LLONG_MIN; int main() { ios_base::sync_with_stdio(0); string s, t; cin >> s >> t; bool ck = true; for (int i = 0; i < s.length(); i++) { if (s[i] != t[i]) {...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
119
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string st, ss; cin >> st; cin >> ss; ss.erase(ss.size() - 1); if (st == ss) printf("YES\n"); else printf("NO\n"); return 0; }
#include <algorithm> #include <cstdio> #include <iostream> #include <string> #include <vector> using namespace std; int main(void) { string st, ss; cin >> st; cin >> ss; ss.erase(ss.size() - 1); if (st == ss) printf("Yes\n"); else printf("No\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
73
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; string ans = "Yes"; for (int i = 0; i < S.size() - 1; i++) { if (S[i] != T[i]) ans = "No"; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S, T; cin >> S >> T; string ans = "Yes"; for (int i = 0; i < S.size(); i++) { if (S[i] != T[i]) ans = "No"; } cout << ans << endl; return 0; }
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
79
import numpy as np import math from collections import Counter s = input() t = input() if s == t[-1]: print("Yes") else: print("No")
import numpy as np import math from collections import Counter s = input() t = input() if s == t[:-1]: print("Yes") else: print("No")
[["+", 0, 57, 15, 666, 0, 206, 206, 663, 0, 102]]
5
43
import sys S = input() T = input() if(S==T[:-1] and len(T) == len(S)+1): print("yes") else: print("no")
import sys S = input() T = input() if(S==T[:-1] and len(T) == len(S)+1): print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
50
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const int mod = 1000000007; const double PI = 3.14159265359; #define INF 1000000000000 #define pb push_back #define pf push_front #define ppb pop_back #define ppf pop_front #define mp make_pair #define lb lower_bound #define ub ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const int mod = 1000000007; const double PI = 3.14159265359; #define INF 1000000000000 #define pb push_back #define pf push_front #define ppb pop_back #define ppf pop_front #define mp make_pair #define lb lower_bound #define ub ...
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
365
#include <bits/stdc++.h> using namespace std; int main() { // long long i,j,t,a,b,n,c,d,y,x,temp,m,r,sum,count,l,k,s,ans,rr,prev; int t = 1; // cin>>t; while (t--) { string s1, s2; cin >> s1 >> s2; if (s1 == s2.substr(0, s1.length())) cout << "YES"; else cout << "NO"; } }
#include <bits/stdc++.h> using namespace std; int main() { // long long i,j,t,a,b,n,c,d,y,x,temp,m,r,sum,count,l,k,s,ans,rr,prev; int t = 1; // cin>>t; while (t--) { string s1, s2; cin >> s1 >> s2; if (s1 == s2.substr(0, s1.length())) cout << "Yes"; else cout << "No"; } }
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
67
X = input() Y = input() if (len(X) + 1 == len(Y)) and X == Y[:-1]: print("yes") else: print("No")
X = input() Y = input() if (len(X) + 1 == len(Y)) and (X == Y[:-1]): print("Yes") else: print("No")
[["+", 0, 656, 0, 57, 15, 679, 12, 23, 0, 24], ["+", 0, 656, 0, 57, 15, 679, 12, 23, 0, 25], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
48
def ABC_167_A(): S = input() T = input() if T.count(S) == 1 and len(T) == len(S) +1 and T.index(S) == 0: print('Yes') else: print('No') if __name__ == '__main__': ABC_167_A()
def ABC_167_A(): S = input() T = input() if T.count(S) >= 1 and len(T) == len(S) +1 and T.index(S) == 0: print('Yes') else: print('No') if __name__ == '__main__': ABC_167_A()
[["-", 0, 57, 15, 679, 31, 679, 31, 666, 667, 60], ["+", 0, 57, 15, 679, 31, 679, 31, 666, 667, 20]]
5
70
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long long int #define ld long double #define INF 1000000007 #define endl "\n" #define pb push_back #define mp make_pair #define FAST_IO \ ios::sync_with_stdio(false...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ul unsigned long long int #define ld long double #define INF 1000000007 #define endl "\n" #define pb push_back #define mp make_pair #define FAST_IO \ ios::sync_with_stdio(false...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
107
#include <iostream> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; if (s1 == s2.substr(0, s2.length() - 1)) cout << "YES" << endl; else cout << "NO" << endl; return 0; }
#include <iostream> using namespace std; int main() { string s1, s2; cin >> s1 >> s2; if (s1 == s2.substr(0, s2.length() - 1)) cout << "Yes" << endl; else cout << "No" << endl; return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
62
#include <bits/stdc++.h> #define ll long long int #define fi first #define se second #define mod 1000000007 #define endl "\n" #define fast \ ios::sync_with_stdio(false); \ cin.tie(0); ...
#include <bits/stdc++.h> #define ll long long int #define fi first #define se second #define mod 1000000007 #define endl "\n" #define fast \ ios::sync_with_stdio(false); \ cin.tie(0); ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
268
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = long long; int main() { string S, T; cin >> S >> T; T.erase(T.size() - 1, 1); if (S == T) { cout << "YES" << endl; } else { cout << "NO" << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = long long; int main() { string S, T; cin >> S >> T; T.erase(T.size() - 1, 1); if (S == T) { cout << "Yes" << endl; } else { cout << "No" << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
77
a = input() b = input() if a == b[:-1] and len(a) + 1 == len(b) : print('Yes') else: print('NO')
a = input() b = input() if a == b[:-1] and len(a) + 1 == len(b) : print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
46
#!/usr/bin/env python3 S = list(input()) T = list(input()) if len(T) == len(S) + 1: flag = True for i in len(S): if S[i] != T[i]: flag = False if flag: print('Yes') else: print('No') else: print('No')
#!/usr/bin/env python3 S = list(input()) T = list(input()) if len(T) == len(S) + 1: flag = True for i in range(len(S)): if S[i] != T[i]: flag = False if flag: print('Yes') else: print('No') else: print('No')
[["+", 0, 57, 64, 196, 0, 7, 12, 652, 63, 22], ["+", 64, 196, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
80
#include <bits/stdc++.h> #define ll long long #define pb push_back #define ppb pop_back #define endl '\n' #define mii map<ll int, ll int> #define msi map<string, ll int> #define mis map<ll int, string> #define rep(i, a, b) for (ll int i = a; i < b; i++) #define repp(i, a, b) for (ll int i = b - 1; i >= a; i--) #define ...
#include <bits/stdc++.h> #define ll long long #define pb push_back #define ppb pop_back #define endl '\n' #define mii map<ll int, ll int> #define msi map<string, ll int> #define mis map<ll int, string> #define rep(i, a, b) for (ll int i = a; i < b; i++) #define repp(i, a, b) for (ll int i = b - 1; i >= a; i--) #define ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
239
s=input() t=input() if len(t)-len(s)==1 and s==t[:len(s)]: print("YES") else: print("No")
s=input() t=input() if len(t)-len(s)==1 and s==t[:len(s)]: print("Yes") else: print("No")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
48
#include <bits/stdc++.h> using namespace std; template <class T> void ckmin(T &a, T b) { a = min(a, b); } template <class T> void ckmax(T &a, T b) { a = max(a, b); } #define pb push_back #define mp make_pair #define cotu cout #define itn int #define Red ...
#include <bits/stdc++.h> using namespace std; template <class T> void ckmin(T &a, T b) { a = min(a, b); } template <class T> void ckmax(T &a, T b) { a = max(a, b); } #define pb push_back #define mp make_pair #define cotu cout #define itn int #define Red ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
295
s = input() t = input() print('Yes' if t[:len(t)-2] == s else 'No')
s = input() t = input() print('Yes' if t[:len(t)-1] == s else 'No')
[["-", 0, 666, 0, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 666, 0, 206, 206, 663, 0, 657, 12, 612]]
5
33
T=input() if S==T[:len(T)-1]: print('Yes') else: print('No')
S=input() T=input() if S==T[:len(T)-1]: print('Yes') else: print('No')
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
33
// Author: Pakhomovee #include <algorithm> #include <chrono> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using namespace std::chrono; #define int long long void solve() { string s, t; ...
// Author: Pakhomovee #include <algorithm> #include <chrono> #include <cmath> #include <iostream> #include <map> #include <set> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; using namespace std::chrono; #define int long long void solve() { string s, t; ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
190
#include <bits/stdc++.h> using namespace std; int main() { string s; string t; cin >> s >> t; int i; for (i = 0; i < s.size(); i++) { if (s[i] != t[i]) break; } if (s.size() == i) cout << "No" << endl; else cout << "Yes" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s; string t; cin >> s >> t; int i; for (i = 0; i < s.size(); i++) { if (s[i] != t[i]) break; } if (s.size() != i) cout << "No" << endl; else cout << "Yes" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
87
#include <bits/stdc++.h> using namespace std; string s, t; int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); cin >> s >> t; for (int i = 0; i < s.size(); ++i) if (s[i] != t[i]) return cout << "NO", 0; cout << "YES" << endl; }
#include <bits/stdc++.h> using namespace std; string s, t; int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); cin >> s >> t; for (int i = 0; i < s.size(); ++i) if (s[i] != t[i]) return cout << "No", 0; cout << "Yes" << endl; }
[["-", 64, 37, 0, 34, 31, 16, 12, 5, 0, 6], ["+", 64, 37, 0, 34, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
72
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string a, c; ll i, j = 0, k, l; cin >> a >> c; for (i = 0; i < a.size(); i++) { if (a[i] != c[i]) { j = 1; } } if (j) printf("NO\n"); else printf("YES\n"); return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { string a, c; ll i, j = 0, k, l; cin >> a >> c; for (i = 0; i < a.size(); i++) { if (a[i] != c[i]) { j = 1; } } if (j) printf("No\n"); else printf("Yes\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
98
pi = 3.1415926 ############ ---- USER DEFINED INPUT FUNCTIONS ---- ############ def inp(): return(int(input().rstrip())) def inlt(): return(list(map(int,input().rstrip().split()))) def insr(): s = input().rstrip() return(s[:len(s) - 1]) def invr(): return(map(int,input().rstrip().split())) ########...
pi = 3.1415926 ############ ---- USER DEFINED INPUT FUNCTIONS ---- ############ def inp(): return(int(input().rstrip())) def inlt(): return(list(map(int,input().rstrip().split()))) def insr(): s = input().rstrip() return(s[:len(s) - 1]) def invr(): return(map(int,input().rstrip().split())) ########...
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
145
#include <bits/stdc++.h> #define MOD 998244353 #define pb push_back #define ll long long int #define con 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll i, j, k, n, m; ll t; string s, s1; cin >> s >> s1; if (s1.size() > 0) { s1 = s1.s...
#include <bits/stdc++.h> #define MOD 998244353 #define pb push_back #define ll long long int #define con 1000000007 using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll i, j, k, n, m; ll t; string s, s1; cin >> s >> s1; if (s1.size() > 0) { s1 = s1.s...
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
133
s = input() n = input() print('YES' if s == n[:-1] else 'NO')
s = input() n = input() print('Yes' if s == n[:-1] else 'No')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
29
#include <bits/stdc++.h> using namespace std; #define inf 2e18 #define bg begin() #define en end() #define ll long long int #define pb push_back #define mp make_pair #define mod 100000000007 #define vi vector<int> #define eb emplace_back #define lb(v, a) lower_bound(v.begin(), v.end(), a) #define ub(v, a) upper_bound(v...
#include <bits/stdc++.h> using namespace std; #define inf 2e18 #define bg begin() #define en end() #define ll long long int #define pb push_back #define mp make_pair #define mod 100000000007 #define vi vector<int> #define eb emplace_back #define lb(v, a) lower_bound(v.begin(), v.end(), a) #define ub(v, a) upper_bound(v...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
361
#include <bits/stdc++.h> #define loop(i, a, n) for (int i = a; i < n; ++i) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ ...
#include <bits/stdc++.h> #define loop(i, a, n) for (int i = a; i < n; ++i) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
115
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define rep(i, n) \ ; \ for (long long i = 0; i < (n); i++) using ll = long long; using P = pair<long long, long lon...
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define rep(i, n) \ ; \ for (long long i = 0; i < (n); i++) using ll = long long; using P = pair<long long, long lon...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
204
s,t = input().split() if t[:len(t)-1] == s: print('Yes') else: print('No')
s = input() t = input() if t[:len(t)-1] == s: print('Yes') else: print('No')
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
39
sys.stdin=f S=input() T=input() for i in range(len(S)): if S[i]==T[i]: continue else: print("No") sys.exit() print("Yes")
import sys S=input() T=input() for i in range(len(S)): if S[i]==T[i]: continue else: print("No") sys.exit() print("Yes")
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 0, 656, 0, 1, 0, 662, 31, 319, 0, 131], ["-", 0, 656, 0, 1, 0, 662, 31, 319, 319, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22]]
5
57
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static long mod = ((long)(1E9 + 7)); public static void main(String[] args) { // Parser scr = new Parser(System.in); FastScanner scr = new FastScanner(); PrintWriter out = new PrintWriter(System.out, true); ...
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static long mod = ((long)(1E9 + 7)); public static void main(String[] args) { // Parser scr = new Parser(System.in); FastScanner scr = new FastScanner(); PrintWriter out = new PrintWriter(System.out, true); ...
[["-", 0, 492, 3, 4, 0, 510, 64, 5, 0, 491], ["+", 0, 492, 3, 4, 0, 510, 64, 5, 0, 491], ["-", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491], ["+", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491]]
3
808
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main(void) { string S, T; cin >> S; cin >> T; for (int i = 0; i < S.length(); i++) { if (S[i] != T[i]) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; ...
#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; int main(void) { string S, T; cin >> S; cin >> T; for (int i = 0; i < S.length(); i++) { if (S[i] != T[i]) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
90
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxs = 5e5 + 5; const ll lmaxs = 20; ll mod = 1e9 + 7; ll oo = 1e15; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxs = 5e5 + 5; const ll lmaxs = 20; ll mod = 1e9 + 7; ll oo = 1e15; #define IOS \ ios_base::sync_with_stdio(false); \ cin.tie(...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
165
#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vll vector<long long> #define pii pair<int, int> #define pll pair<ll, ll> #define sll set<long long> #define si set<int> #define stk stack<int> #define que queue<int> #define pb push_back #define ff first #define ss second #define IOS ...
#include <bits/stdc++.h> #define ll long long #define vi vector<int> #define vll vector<long long> #define pii pair<int, int> #define pll pair<ll, ll> #define sll set<long long> #define si set<int> #define stk stack<int> #define que queue<int> #define pb push_back #define ff first #define ss second #define IOS ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
144
s=input() y=input() if (s==y[:-1]): print('Yes') else: print('No)')
s=input() y=input() if (s==y[:-1]): print('Yes') else: print('No')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
36
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define INF 0x3f3f3f3f #define all(x) (x).begin(), (x).end() #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define INF 0x3f3f3f3f #define all(x) (x).begin(), (x).end() #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["-", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22], ["+", 0, 43, 49, 50, 51, 2, 63, 118, 28, 22]]
1
138
#include <bits/stdc++.h> #define INF 2000000000 #define MOD 1000000007 #define EPS (1e-10) using namespace std; int main(int argc, char *argv[]) { string s; cin >> s; string t; cin >> t; for (int i = 0; i < s.size(); i++) { if (s[i] != t[i]) { cout << "NO" << endl; return 0; } } co...
#include <bits/stdc++.h> #define INF 2000000000 #define MOD 1000000007 #define EPS (1e-10) using namespace std; int main(int argc, char *argv[]) { string s; cin >> s; string t; cin >> t; for (int i = 0; i < s.size(); i++) { if (s[i] != t[i]) { cout << "No" << endl; return 0; } } co...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
99
#include <bits/stdc++.h> using namespace std; const int Nmax = 2e5 + 10; const int Mod = 1e9 + 7; const int oo = 1e9; char s[Nmax], t[Nmax]; int main() { /** #ifndef ONLINE_JUDGE ifstream cin("test.in"); ofstream cout("test.out"); #endif // ONLINE_JUDGE */ cin >> s >> t; in...
#include <bits/stdc++.h> using namespace std; const int Nmax = 2e5 + 10; const int Mod = 1e9 + 7; const int oo = 1e9; char s[Nmax], t[Nmax]; int main() { /** #ifndef ONLINE_JUDGE ifstream cin("test.in"); ofstream cout("test.out"); #endif // ONLINE_JUDGE */ cin >> s >> t; in...
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
123
#include <bits/stdc++.h> //--------------------------------------------------------------- #define ll long long #define ld long double #define mod 1000000007 #define MAX 100005 #define pi 3.141592653589793238 // shortcut keys #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fast ...
#include <bits/stdc++.h> //--------------------------------------------------------------- #define ll long long #define ld long double #define mod 1000000007 #define MAX 100005 #define pi 3.141592653589793238 // shortcut keys #define pb push_back #define mp make_pair #define all(x) x.begin(), x.end() #define fast ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
120
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long int lld; const lld N = 200043; const lld MOD = 1000000007; lld add(lld x, lld y) { x += y; while (x >= MOD) x -= MOD; while (x < 0) x += MOD; return x; } lld mul(lld x, lld y) { return (x * 1ll * y) % MOD; }...
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long int lld; const lld N = 200043; const lld MOD = 1000000007; lld add(lld x, lld y) { x += y; while (x >= MOD) x -= MOD; while (x < 0) x += MOD; return x; } lld mul(lld x, lld y) { return (x * 1ll * y) % MOD; }...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
290
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target( \ "avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") us...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma GCC target( \ "avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") us...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
597
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define pb push_back #define MOD 1000000007 #define inf 3e18 #define vi vector<int> #define vld vector<ld> #define pii pair<int, int> #define mii map<int, int> #define fi first #define se second #define fastIO ...
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define pb push_back #define MOD 1000000007 #define inf 3e18 #define vi vector<int> #define vld vector<ld> #define pii pair<int, int> #define mii map<int, int> #define fi first #define se second #define fastIO ...
[["+", 0, 57, 15, 339, 51, 16, 12, 23, 0, 24], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
314
import sys S = sys.stdin.readline().rstrip() T = sys.stdin.readline().rstrip() if S[:-1] == T: print('Yes') else: print("No")
import sys S = sys.stdin.readline().rstrip() T = sys.stdin.readline().rstrip() if S == T[:-1]: print('Yes') else: print("No")
[["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
52
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll mod = 1e9 + 7; #define PI 3.1415926535897932385 #define INF 100000000000000000ll #define fastio \ ios_base::sync_with_stdio(false); ...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long ll mod = 1e9 + 7; #define PI 3.1415926535897932385 #define INF 100000000000000000ll #define fastio \ ios_base::sync_with_stdio(false); ...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
197
#if __has_include("D:/dhiraj/Programming/debug.h") #include "D:/dhiraj/Programming/debug.h" #else #include <bits/stdc++.h> using namespace std; #define d(...) 11 #define dash 12 #endif // Loops -------------------------------------------------------------------- #define loop(i, s, e) for (ll i = (s); i < (e); i++) #d...
#if __has_include("D:/dhiraj/Programming/debug.h") #include "D:/dhiraj/Programming/debug.h" #else #include <bits/stdc++.h> using namespace std; #define d(...) 11 #define dash 12 #endif // Loops -------------------------------------------------------------------- #define loop(i, s, e) for (ll i = (s); i < (e); i++) #d...
[["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
368
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(n) begin(n), end(n) #define IN(a, x, b)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(n) begin(n), end(n) #define IN(a, x, b)...
[["-", 15, 339, 51, 16, 12, 2, 63, 118, 28, 22], ["+", 15, 339, 51, 16, 12, 2, 63, 118, 28, 22]]
1
252
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; t.erase(s.size()); if (s == t) { cout << "YES" << endl; } else { cout << "NO" << endl; } ...
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <string> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; t.erase(s.size()); if (s == t) { cout << "Yes" << endl; } else { cout << "No" << endl; } ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
78
s = input() t = input() if len(t) == len(s) + 1 and t[0:len(t)] == s: print('Yes') else: print('No')
s = input() t = input() if len(t) == len(s) + 1 and t[0:len(t)-1] == s: print('Yes') else: print('No')
[["+", 12, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 12, 666, 0, 206, 206, 663, 0, 657, 12, 612]]
5
49
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int main() { string s; cin >> s; string t; cin >> t; ll fl = 0; for (ll i = 0; i < s.size(); i++) { if (s[i] != t[i]) fl = 1; } if (fl == 1) cout << "NO" << endl; else { cout << "YES" << endl; }...
#include <bits/stdc++.h> #include <iostream> using namespace std; #define ll long long int main() { string s; cin >> s; string t; cin >> t; ll fl = 0; for (ll i = 0; i < s.size(); i++) { if (s[i] != t[i]) fl = 1; } if (fl == 1) cout << "No" << endl; else { cout << "Yes" << endl; }...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
100
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; string s, t; bool res = true; int main() { cin >> s >> t; for (int i = 0; i < s.size() - 1; i++) { if (s[i] != t[i]) res = false; } if (res) cout << "Yes" <<...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <string> #include <vector> using namespace std; string s, t; bool res = true; int main() { cin >> s >> t; for (int i = 0; i < s.size(); i++) { if (s[i] != t[i]) res = false; } if (res) cout << "Yes" << end...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
100
s=input() t=input() l=len(t) print('Yes' if s in t[:l] else 'No')
s=input() t=input() l=len(t)-1 print('Yes' if s in t[:l] else 'No')
[["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]]
5
34
s=input() t=input() if s==s[:len(s)]: print('Yes') else: print('No')
s=input() t=input() if s==t[:len(t)-1]: print('Yes') else: print('No')
[["-", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 0, 206, 206, 663, 0, 652, 3, 4, 0, 22], ["+", 206, 663, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 17, 33], ["+", 15, 666, 0, 206, 206, 663, 0, 657, 12, 612]]
5
36
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s, t; cin >> s; cin >> t; t.pop_back(); if (s == t) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { string s, t; cin >> s; cin >> t; t.pop_back(); if (s == t) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
64
#include <bits/stdc++.h> using namespace std; #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORd(i, a, b) for (int i = (a)-1; i >= (b); i--) #define FORall(it, a) \ for (__typeof((a).begin()) it = (a).beg...
#include <bits/stdc++.h> using namespace std; #define ms(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORd(i, a, b) for (int i = (a)-1; i >= (b); i--) #define FORall(it, a) \ for (__typeof((a).begin()) it = (a).beg...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
699
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define int long long #define fast_io \ ios::sync_with_stdio(0); ...
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iostream> #include <map> #include <set> #include <string> #include <vector> #define int long long #define fast_io \ ios::sync_with_stdio(0); ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
253
#include <bits/stdc++.h> #define FOR0(i, n) for (int i = 0; i < n; i++) #define FOR(i, j, n) for (int i = j; i < n; i++) // bool isEven(ll n) {return (n%2!=0)?false:true;}; #define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s #define f(i, a, b) for (i = a; i < b; i++) #define rep(i, n) f(i, 0, n) #...
#include <bits/stdc++.h> #define FOR0(i, n) for (int i = 0; i < n; i++) #define FOR(i, j, n) for (int i = j; i < n; i++) // bool isEven(ll n) {return (n%2!=0)?false:true;}; #define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s #define f(i, a, b) for (i = a; i < b; i++) #define rep(i, n) f(i, 0, n) #...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
175
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define floop(i, a, n) for (int i = a; i < n; i++) #define rfloop(i, a, n) for (int i = n - 1; i >= a; i--) #define mloop(it, x) for (it = x.begin(); it != x.end(); it+...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define floop(i, a, n) for (int i = a; i < n; i++) #define rfloop(i, a, n) for (int i = n - 1; i >= a; i--) #define mloop(it, x) for (it = x.begin(); it != x.end(); it+...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
722
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { string a, b; cin >> a; cin >> b; bool judge = true; for (int i = 0; i < a.length(); i++) { if (a[i] != b[i]) judge = false; break; } if (judge) cout << "Yes" << endl; else cout ...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 typedef long long ll; int main() { string a, b; cin >> a; cin >> b; bool judge = true; for (int i = 0; i < a.length(); i++) { if (a[i] != b[i]) judge = false; } if (judge) cout << "Yes" << endl; else cout << "No" << ...
[["-", 8, 9, 0, 7, 8, 9, 0, 93, 0, 94], ["-", 8, 9, 0, 7, 8, 9, 0, 93, 0, 35]]
1
97
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define trav(a, x) for (auto &a : x) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define PB push_back struct edge { int to; }; using graph = vector<vector...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; #define rep(i, a, b) for (int i = a; i < (b); ++i) #define trav(a, x) for (auto &a : x) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define PB push_back struct edge { int to; }; using graph = vector<vector...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
159
s = input() t = input() if s[:-1] == t: if len(t) == len(s) + 1: print("Yes") else: print("No") else: print("No")
s = input() t = input() if t[:-1] == s: if len(t) == len(s) + 1: print("Yes") else: print("No") else: print("No")
[["-", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 206, 51, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
55
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); string s1; string s2; cin >> s1 >> s2; if (s1.length() + 1 == s2.length()) { for (int i = 0; i < s1.length(); ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); string s1; string s2; cin >> s1 >> s2; if (s1.length() + 1 == s2.length()) { for (int i = 0; i < s1.length(); ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
126
a = input() b = input() for i in range(len(b)): if a[i] != b[i]: print("No") break if i == len(b) - 1: print("Yes")
a = input() b = input() for i in range(len(a)): if a[i] != b[i]: print("No") break if i == len(a) - 1: print("Yes")
[["-", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["-", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 22]]
5
55
S=input() T=input() U=T[:len(T)-1] print(U) print("Yes" if(len(S)+1 == len(T) and S==U) else "No")
S=input() T=input() U=T[:len(T)-1] print("Yes" if(len(S)+1 == len(T) and S==U) else "No")
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]]
5
54
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int i; for (i = 0; i < s.size() - 1; i++) { if (s[i] != t[i]) { cout << "No" << "\n"; return 0; } else continue; } cout << "Yes" << "\n"; ret...
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { string s, t; cin >> s >> t; int i; for (i = 0; i < s.size(); i++) { if (s[i] != t[i]) { cout << "No" << "\n"; return 0; } else continue; } cout << "Yes" << "\n"; return ...
[["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
94
S = list(input()) T = list(input()) ans = ''.join(S) + T[-1] print(ans) if ans == ''.join(T): print("Yes") else: print("No")
S = list(input()) T = list(input()) ans = ''.join(S) + T[-1] if ans == ''.join(T): print("Yes") else: print("No")
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
60
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(v) v.begin(), v.end() using ll = long long; using ull = unsigned long long; using namespace std; int main() { string S, T; cin >> S >> T; bool can = ...
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, m, n) for (int i = m; i < n; i++) #define ALL(v) v.begin(), v.end() using ll = long long; using ull = unsigned long long; using namespace std; int main() { string S, T; cin >> S >> T; bool can = ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
128
/* winners never quit and quitters never win. #swap */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #pragma GCC optimize("-O3") using ll = long long; using ld = long double; ...
/* winners never quit and quitters never win. #swap */ #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #pragma GCC optimize("-O3") using ll = long long; using ld = long double; ...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
503
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(i, l, r) for (int(i) = int(l); int(i) <= i...
#include <algorithm> #include <cmath> #include <cstdio> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define FOR(i, l, r) for (int(i) = int(l); int(i) <= i...
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
1,477
#include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, \ tree_order_statistics_node_update> using namespa...
#include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, \ tree_order_statistics_node_update> using namespa...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
258
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string a, b; cin >> a >> b; b.pop_back(); cout << (a == b ? "YES" : "NO") << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string a, b; cin >> a >> b; b.pop_back(); cout << (a == b ? "Yes" : "No") << '\n'; return 0; }
[["-", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 31, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
76
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <...
#define _USE_MATH_DEFINES #include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <...
[["-", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 64, 5, 0, 6], ["-", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6], ["+", 0, 16, 12, 23, 0, 41, 75, 5, 0, 6]]
1
374
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #in...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <iterator> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #in...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
852
#include "bits/stdc++.h" // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #define ld long double #define vi vector<int> #define pii pair<int, int> #define pb push_back #define mp make_pair #define ff first #define ss second #define end...
#include "bits/stdc++.h" // #include<ext/pb_ds/assoc_container.hpp> // #include<ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; using namespace std; #define ld long double #define vi vector<int> #define pii pair<int, int> #define pb push_back #define mp make_pair #define ff first #define ss second #define end...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
253
#include "algorithm" #include "iostream" #include "map" #include "queue" #include "set" #include "string" #include "unordered_map" #include "unordered_set" #include "vector" using namespace std; #define ll long long #define INF 2e9 #define INF2 4611686018427387904 //#define MOD 1000000007 #define MOD 998244353 #defin...
#include "algorithm" #include "iostream" #include "map" #include "queue" #include "set" #include "string" #include "unordered_map" #include "unordered_set" #include "vector" using namespace std; #define ll long long #define INF 2e9 #define INF2 4611686018427387904 //#define MOD 1000000007 #define MOD 998244353 #defin...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
1,355
#include <bits/stdc++.h> #define int long long //#pragma GCC optimize("Ofast") //#pragma comment(linker, "/stack:200000000") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4") #define file(s) \ freopen(s ".in", "r", stdin); ...
#include <bits/stdc++.h> #define int long long //#pragma GCC optimize("Ofast") //#pragma comment(linker, "/stack:200000000") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4") #define file(s) \ freopen(s ".in", "r", stdin); ...
[["-", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22], ["+", 8, 9, 0, 1, 0, 2, 63, 118, 28, 22]]
1
259
#include <bits/stdc++.h> #define DAU \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define PLEC return 0; using namespac...
#include <bits/stdc++.h> #define DAU \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define PLEC return 0; using namespac...
[["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
67
a, b, c, k = map(int, input().split()) ans = 0 if a >= k: ans = a elif a + b >= k: ans = a else: ans = a + ((k - a - b) * (-1)) print(ans)
a, b, c, k = map(int, input().split()) ans = 0 if a >= k: ans = k elif a + b >= k: ans = a else: ans = a + ((k - a - b) * (-1)) print(ans)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 22]]
5
65
a,b,c,k=map(int,input().split()) ans=a if k-a<=0: print(ans) exit() if k-a-b<=0: print(ans) exit() if k-a-b-c<0: ans=ans+(k-a-b)*(-1) print(ans) else: ans=ans-c print(ans)
a,b,c,k=map(int,input().split()) ans=a if k-a<=0: print(k) exit() if k-a-b<=0: print(ans) exit() if k-a-b-c<0: ans=ans+(k-a-b)*(-1) print(ans) else: ans=ans-c print(ans)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
95
#include <bits/stdc++.h> using namespace std; const int mod = 200003; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; #define pb push_back #define mp make_pair #define F first #define S second #define all(x) x....
#include <bits/stdc++.h> using namespace std; const int mod = 200003; typedef long long ll; typedef vector<int> vi; typedef vector<long long> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ll, int> pli; #define pb push_back #define mp make_pair #define F first #define S second #define all(x) x....
[["-", 64, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
242
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << a << endl; else if (a < k && k <= a + b) cout << a << endl; else cout << 2 * a + b - k << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << k << endl; else if (a < k && k <= a + b) cout << a << endl; else cout << 2 * a + b - k << endl; }
[["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22]]
1
75
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, C, k, q, w; cin >> A >> B >> C >> k; long long a = A, b = 0, c = C * -1; if (A >= k) cout << a; else if (A + B + C == k) cout << a + c; else { q = k - A; if (B >= q) cout << a; else { w = q - B; ...
#include <bits/stdc++.h> using namespace std; int main() { long long A, B, C, k, q, w; cin >> A >> B >> C >> k; int a = A, b = 0, c = C * -1; if (A >= k) cout << k; else if (A + B + C == k) cout << a + c; else { q = k - A; if (B >= q) cout << a; else { w = q - B; w = w ...
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
119
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <math.h> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) int main() { ll a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << k << "\n"; if (k <= a + b) ...
#include <algorithm> #include <cstdlib> #include <cstring> #include <iostream> #include <math.h> #include <vector> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) int main() { ll a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << k << "\n"; else { if (k <= ...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
103
A,B,C,K=map(int,input().split()) print(1*min(A,K)-(1*(K-A-B)))
A,B,C,K=map(int,input().split()) print(1*min(A,K)-1*max(0,K-A-B))
[["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 24], ["+", 3, 4, 0, 657, 12, 657, 12, 652, 63, 22], ["+", 0, 657, 12, 657, 12, 652, 3, 4, 0, 612], ["+", 0, 657, 12, 657, 12, 652, 3, 4, 0, 21], ["-", 0, 657, 12, 23, 0, 657, 12, 23, 0, 25]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { int i, j, k, o; cin >> i >> j >> k >> o; if (o >= i) { cout << o; } else if (i - o <= j) { cout << i; } else { cout << i - (o - i - j); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int i, j, k, o; cin >> i >> j >> k >> o; if (o <= i) { cout << o; } else if (o - i <= j) { cout << i; } else { cout << i - (o - i - j); } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
76
// https://atcoder.jp/contests/abc167/tasks/abc167_b #include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); ll a; cin >> a; ll b; cin >> b; ll c; cin >> c; ll k; cin >> k; ll d; if (a >= k) { cout << a << "\n"; } else if...
// https://atcoder.jp/contests/abc167/tasks/abc167_b #include <bits/stdc++.h> #define ll long long int using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); ll a; cin >> a; ll b; cin >> b; ll c; cin >> c; ll k; cin >> k; ll d; if (a >= k) { cout << k << "\n"; } else if...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 44]]
1
134
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll a, b, c, k; cin >> a >> b >> c >> k; ll ans = 0; if (k > a) { ans += a; k -= a; if (k > b) { k -= b; if (k < c) { ans -= ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll a, b, c, k; cin >> a >> b >> c >> k; ll ans = 0; if (k > a) { ans += a; k -= a; if (k > b) { k -= b; if (k <= c) { ans -=...
[["-", 64, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 64, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
116
x,y,z,a=gets.split.map!(&:to_i) ans=0 if a<x ans=a-x elsif a-x<y ans=x elsif a-x-y<z ans=x-(a-x-y) else ans=x-z end puts ans
x,y,z,a=gets.split.map!(&:to_i) ans=0 if a<x ans=a elsif a-x<y ans=x elsif a-x-y<z ans=x-(a-x-y) else ans=x-z end puts ans
[["-", 0, 121, 64, 749, 0, 662, 12, 738, 17, 33], ["-", 0, 121, 64, 749, 0, 662, 12, 738, 12, 22]]
4
66
a,b,c,k=map(int,open(0).read().split()) if k<=a+b: print(a) else: cntc=k-a-b print(a-cntc)
a,b,c,k=map(int,open(0).read().split()) if k<=a+b: print(min(a,k)) else: cntc=k-a-b print(a-cntc)
[["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 21], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 22], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
51
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << a << endl; else { int tmp = k - a; if (tmp <= b) cout << a << endl; else cout << a - (tmp - b) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; if (k <= a) cout << k << endl; else { int tmp = k - a; if (tmp <= b) cout << a << endl; else cout << a - (tmp - b) << endl; } }
[["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22]]
1
78
A, B, C, K = map(int, input().split()) if (K - A) <= 0: print(A) else: if (K - A - B) <= 0: print(A) else: c = (K - A - B) print(A - c)
A, B, C, K = map(int, input().split()) if (K - A) <= 0: print(K) else: if (K - A - B) <= 0: print(A) else: c = (K - A - B) print(A - c)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
67
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
[["-", 12, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 12, 16, 12, 23, 0, 16, 17, 33]]
1
234
#include <stdio.h> int main(void) { int A, B, C, K, P = 0; scanf("%d%d%d%d", &A, &B, &C, &K); if (K <= A) P = K; else if (K <= A + B) P = A; else P - (K - (A + B)); printf("%d\n", P); return 0; }
#include <stdio.h> int main(void) { int A, B, C, K, P = 0; scanf("%d%d%d%d", &A, &B, &C, &K); if (K <= A) P = K; else if (K <= A + B) P = A; else P = A - (K - A - B); printf("%d\n", P); return 0; }
[["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 0, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["-", 12, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 16, 12, 23, 0, 16, 12, 23, 0, 25]]
0
90
a, b, c, k = map(int, input().split()) import sys ans = 0 if a != 0 and a >= k: # a = 1 print(a) sys.exit() elif a != 0: ans += a k -= a if b != 0 and b >= k: print(ans) sys.exit() elif b != 0: k -= b ans += k * -1 print(ans)
a, b, c, k = map(int, input().split()) import sys ans = 0 if a != 0 and a >= k: # a = 1 print(k) sys.exit() elif a != 0: ans += a k -= a if b != 0 and b >= k: print(ans) sys.exit() elif b != 0: k -= b ans += k * -1 print(ans)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
91
A, B, C, K = list(map(lambda x : int(x), input().split(" "))) if A >= K: print(K) elif A + B >= K: print(A) else: print(2 * A - B - K)
A, B, C, K = list(map(lambda x : int(x), input().split(" "))) if A >= K: print(K) elif A + B >= K: print(A) else: print(2 * A + B - K)
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 33], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 72]]
5
64
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; int ans; if (a >= k) { ans = a; } else if (a < k && a + b >= k) { ans = a; } else { ans = 2 * a + b - k; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, k; cin >> a >> b >> c >> k; int ans; if (a >= k) { ans = k; } else if (a < k && a + b >= k) { ans = a; } else { ans = 2 * a + b - k; } cout << ans << endl; }
[["-", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 22]]
1
84
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, k; cin >> a >> b >> c >> k; if (k == a + b + c) { cout << (a - c); } else if (k > a + b && k < a + b + c) { cout << a - (k - (a + b)); } else if (k > a && k <= a + b) { cout << a; } else { cout << a; } return...
#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, k; cin >> a >> b >> c >> k; if (k == a + b + c) { cout << (a - c); } else if (k > a + b && k < a + b + c) { cout << a - (k - (a + b)); } else if (k > a && k <= a + b) { cout << a; } else { cout << k; } return...
[["-", 75, 76, 0, 9, 0, 1, 0, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 12, 22]]
1
114