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 <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <tuple> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <string> #include <time.h> #include <tuple> #include <...
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
656
#include <bits/stdc++.h> using namespace std; #define ll long long const int MOD = 1e9 + 7; void setIO() { ios_base::sync_with_stdio(0); cin.tie(0); } int main() { setIO(); string s; int k; cin >> s; cin >> k; if (s.length() >= k) { cout << s << "\n"; } else { for (int i = 0; i < k; ++i) { ...
#include <bits/stdc++.h> using namespace std; #define ll long long const int MOD = 1e9 + 7; void setIO() { ios_base::sync_with_stdio(0); cin.tie(0); } int main() { setIO(); string s; int k; cin >> k; cin >> s; if (s.length() <= k) { cout << s << "\n"; } else { for (int i = 0; i < k; ++i) { ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
114
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.size() <= k) { cout << s << "\n"; } else { cout << s.erase(k + 1) + "...\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.size() <= k) { cout << s << "\n"; } else { cout << s.erase(k) + "...\n"; } }
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
63
// インクルード #include <bits/stdc++.h> // 名前空間省略 using namespace std; // メイン関数 int main() { // 標準入出力 高速化 ios::sync_with_stdio(false); cin.tie(nullptr); int k; string s; cin >> k; cin >> s; if (s.length() < k) cout << s << endl; else { cout << s.substr(0, k) + "..." << endl; } }
// インクルード #include <bits/stdc++.h> // 名前空間省略 using namespace std; // メイン関数 int main() { // 標準入出力 高速化 ios::sync_with_stdio(false); cin.tie(nullptr); int k; string s; cin >> k; cin >> s; if (s.length() <= k) cout << s << endl; else { cout << s.substr(0, k) + "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
80
a=int(input()) b=input() c=len(b) if c>(a-1): print(b[:a]+'...') else: print(b)
a=int(input()) b=input() c=len(b) if c>a: print(b[:a]+'...') else: print(b)
[["-", 0, 656, 0, 57, 15, 666, 0, 23, 0, 24], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 17, 33], ["-", 0, 57, 15, 666, 0, 23, 0, 657, 12, 612], ["-", 0, 656, 0, 57, 15, 666, 0, 23, 0, 25]]
5
46
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (k < s.size()) { for (int i = 0; i < k; i++) { cout << s[i]; cout << "..."; return 0; } } if (k >= s.size()) { cout << s; return 0; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (k < s.size()) { for (int i = 0; i < k; i++) cout << s[i]; cout << "..."; return 0; } if (k >= s.size()) { cout << s; return 0; } return 0; }
[["-", 0, 57, 64, 9, 0, 7, 8, 9, 0, 45], ["-", 0, 57, 64, 9, 0, 7, 8, 9, 0, 46]]
1
90
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int k; k = scan.nextInt(); String s; s = scan.next(); int num = s.length(); if (k >= num) System.out.println(s); else { String str = s.substring(s.length()...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int k; k = scan.nextInt(); String s; s = scan.next(); int num = s.length(); if (k >= num) System.out.println(s); else { String str = s.substring(0, k); ...
[["-", 51, 492, 3, 4, 0, 16, 31, 492, 500, 22], ["-", 51, 492, 3, 4, 0, 16, 31, 492, 0, 131], ["-", 51, 492, 3, 4, 0, 16, 31, 492, 141, 22], ["-", 3, 4, 0, 16, 31, 492, 3, 4, 0, 24], ["-", 3, 4, 0, 16, 31, 492, 3, 4, 0, 25], ["-", 49, 200, 51, 492, 3, 4, 0, 16, 17, 33], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 499], ["...
3
112
#include <bits/stdc++.h> #define int long long int using namespace std; int32_t main() { ios_base::sync_with_stdio(false); int k; string s, s1; cin >> k; cin >> s; if (s.length() > k) { s1 = s.substr(0, k); cout << s1 << "...."; return 0; } cout << s << "\n"; }
#include <bits/stdc++.h> #define int long long int using namespace std; int32_t main() { ios_base::sync_with_stdio(false); int k; string s, s1; cin >> k; cin >> s; if (s.length() > k) { s1 = s.substr(0, k); cout << s1 << "..."; return 0; } cout << s << "\n"; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
80
function Main(input) { inp = input.split("\n") k = parseInt(inp[0]) s = inp[1] console.log(s.length < k ? s : s.slice(0, k) + '...') } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) { inp = input.split("\n") var k = parseInt(inp[0]) var s = inp[1] console.log(s.length <= k ? s : s.slice(0, k) + '...') } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["+", 0, 493, 0, 435, 8, 556, 0, 198, 0, 217], ["-", 0, 2, 3, 3, 0, 510, 15, 16, 17, 18], ["+", 0, 2, 3, 3, 0, 510, 15, 16, 17, 19]]
2
78
#include <iostream> using namespace std; using ll = long long; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= (size_t)k) cout << s << endl; else cout << s.substr(0, 7) + "..." << endl; return 0; }
#include <iostream> using namespace std; using ll = long long; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= (size_t)k) cout << s << endl; else cout << s.erase(k) + "..." << endl; return 0; }
[["-", 31, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["+", 31, 16, 12, 16, 31, 2, 63, 118, 119, 120], ["-", 31, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["-", 31, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22]]
1
72
K = input() S = input() strings = '' if len(K) >= len(S): print(S) else: strings = str(S[:K]) + '...' print(strings)
K = int(input()) S = input() strings = '' if K >= len(S): print(S) else: strings = str(S[:K]) + '...' print(strings)
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 57, 15, 666, 0, 652, 63, 22], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["-", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25]]
5
49
n = input() m = input() m_1 = list(m) if len(m_1)>int(n): a = "".join(m_1[0:int(n)]) print(a+"...") else: print(n)
n = input() m = input() m_1 = list(m) if len(m_1)>int(n): a = "".join(m_1[0:int(n)]) print(a+"...") else: print(m)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
58
k = int(input()) s = input() if len(s) >= k: s = s[0:k] s = s + '...' print(s)
k = int(input()) s = input() if len(s) > k: s = s[0:k] s = s + '...' print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s = "...", ans; cin >> ans; if (ans.length() >= n) { ans = ans.substr(0, n); ans += s; } /* set<int>a={2,4,5,7,9},b={0,1,6,8}; n=n%10; if(a.count(n)) s="h"+s; else if(b.count(n)) s="p"+s; else s="b"+s;*...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s = "...", ans; cin >> ans; if (ans.length() > n) { ans = ans.substr(0, n); ans += s; } /* set<int>a={2,4,5,7,9},b={0,1,6,8}; n=n%10; if(a.count(n)) s="h"+s; else if(b.count(n)) s="p"+s; else s="b"+s;*/...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
66
#include <cstring> #include <iostream> #include <string> using namespace std; bool func(string a) { for (int i = 0; a.length(); i++) { if (!islower(a[i])) { return false; } } return true; } int main() { int k; cin >> k; string s; cin >> s; string s1 = "..."; if (func(s)) { if (s.leng...
#include <cstring> #include <iostream> #include <string> using namespace std; bool fun(string a) { for (int i = 0; i < a.length(); i++) { if (isupper(a[i])) { return false; } } return true; } int main() { int k; cin >> k; string s; cin >> s; string s1 = "..."; if (fun(s)) { if (s.len...
[["-", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 36, 36, 0, 30, 0, 14, 49, 53, 49, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 91, 17, 111], ["-", 0, 57, 15, 339, 51, 91, 28, 2, 63, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 2, 63, 22], ["-", 8, ...
1
131
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdint> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #includ...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdint> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <numeric> #include <queue> #include <set> #include <stack> #include <string.h> #includ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
98
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.length() <= k) { cout << s << "\n"; } else { for (int i = 0; i < k; i++) { cout << s[i] << "...\n"; } } return 0; }
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.length() <= k) { cout << s << "\n"; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "...\n"; } return 0; }
[["+", 0, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46]]
1
78
#include <bits/stdc++.h> using namespace std; int main(void) { int n; string s; cin >> n; cin >> s; if (n > s.size()) { cout << s << endl; } else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main(void) { int n; string s; cin >> n; cin >> s; if (n >= s.size()) { cout << s << endl; } else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
79
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N; cin >> S; if (N >= S.size()) { cout << S << endl; } else { S = S.substr(0, N) + "…"; cout << S << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int N; string S; cin >> N; cin >> S; if (N >= S.size()) { cout << S << endl; } else { S = S.substr(0, N) + "..."; cout << S << endl; } }
[["-", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6]]
1
68
K=int(input()) S=input() slen=len(S) if slen > K: print (S[0:K]+"...")
K=int(input()) S=input() slen=len(S) if slen > K: print (S[0:K]+"...") else: print (S)
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102], ["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
37
def solution(): k = int(input()) s = int(input()) if len(s) > k: return s[:k] + '...' else: return s print(solution())
def solution(): k = int(input()) s = str(input()) if len(s) > k: return s[:k] + '...' else: return s print(solution())
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
49
#include <stdio.h> #include <string.h> int main() { int K; scanf("%d", &K); char str[100]; scanf("%s", str); int len = (int)strlen(str); if (len < K) { printf("%s", str); } else { for (int i = 0; K > i; i++) { printf("%c", str[i]); } printf("..."); } return 0; }
#include <stdio.h> #include <string.h> int main() { int K; scanf("%d", &K); char str[100]; scanf("%s", str); int len = (int)strlen(str); if (len <= K) { printf("%s", str); } else { for (int i = 0; K > i; i++) { printf("%c", str[i]); } printf("..."); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
107
K = int(input()) S = input() if len(S) <= K: print(S) else: print("{}...".format(S[0,K]))
K = int(input()) S = input() if len(S) <= K: print(S) else: print("{}...".format(S[:K]))
[["-", 3, 4, 0, 652, 3, 4, 0, 206, 206, 612], ["-", 3, 4, 0, 652, 3, 4, 0, 206, 0, 21], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 102]]
5
43
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int k; cin >> k; string s; cin >> s; if ((int)s.size() < k) cout << s << endl; else cout << s.substr(0, k) + "..." << endl; return 0; }
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int k; cin >> k; string s; cin >> s; if ((int)s.size() <= k) cout << s << endl; else cout << s.substr(0, k) + "..." << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
82
input_1=input() input_2=input() #print(input_1) #print(input_2) length = len(input_2) #print(length) if int(length) <= int(input_1): print(input_2) else: print(input_2[:int(input_1)]+"…")
input_1=input() input_2=input() #print(input_1) #print(input_2) length = len(input_2) #print(length) if int(length) <= int(input_1): print(input_2) else: print(input_2[:int(input_1)]+"...")
[["-", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6]]
5
51
#include <bits/stdc++.h> #define int long long #define rep(i, x, y) for (int i = x; i < y; i++) #define repr(i, x, y) for (int i = x; i >= y; i--) #define mod 1000000007 using namespace std; void Onigiri() { int k; cin >> k; string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (i >= k) cou...
#include <bits/stdc++.h> #define int long long #define rep(i, x, y) for (int i = x; i < y; i++) #define repr(i, x, y) for (int i = x; i >= y; i--) #define mod 1000000007 using namespace std; void Onigiri() { int k; cin >> k; string s; cin >> s; for (int i = 0; i < s.length(); i++) { if (i >= k) { c...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
190
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //#pragma GCC optimize("unroll-loops") //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define fi...
#include <bits/stdc++.h> //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") //#pragma GCC optimize("unroll-loops") //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; // using namespace __gnu_pbds; #define fi...
[["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
959
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin.ignore(); getline(cin, s); if (s.length() > n) { cout << s.substr(0, n) << "..."; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin.ignore(); getline(cin, s); if (s.length() > n) { cout << s.substr(0, n) << "..."; } else cout << s; return 0; }
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 75, 76, 0, 1, 0, 35]]
1
65
def main(): K = int(input()) S = input() if(len(S) < K): print(S) else: print(S[:K] + '...') if __name__ == '__main__': main()
def main(): K = int(input()) S = input() if(len(S) <= K): print(S) else: print(S[:K] + '...') if __name__ == '__main__': main()
[["-", 8, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 8, 196, 0, 57, 15, 23, 0, 666, 667, 19]]
5
56
k = int(input()) s = input() if len(s) <= k: print(s) else: res = s[1:k] res += "..." print(res)
k = int(input()) s = input() if len(s) <= k: print(s) else: res = s[0:k] res += "..." print(res)
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612]]
5
44
k = int(input()) S = input() if len(S) > K: print(S[:K]+"...") else: print(S)
K = int(input()) S = input() if len(S) > K: print(S[:K]+"...") else: print(S)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
39
#include <bits/stdc++.h> #define ll long long #define FOR(x, y, z) for (ll x = y; x <= (ll)z; x++) #define line cout << endl using namespace std; void B() { int k; string s; cin >> k >> s; if (s.length() > k) { FOR(i, 0, k - 1) { cout << s[i] << "..."; } } else { cout << s; } } int main() { io...
#include <bits/stdc++.h> #define ll long long #define FOR(x, y, z) for (ll x = y; x <= (ll)z; x++) #define line cout << endl using namespace std; void B() { int k; string s; cin >> k >> s; if (s.length() > k) { FOR(i, 0, k - 1) { cout << s[i]; } cout << "..."; } else { cout << s; } } int mai...
[["+", 0, 57, 64, 9, 0, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 9, 0, 46], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 9, 0, 9, 0, 46]]
1
107
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; if (s.size() == n) cout << s << endl; else if (s.size() > n) { for (int i = 0; i < n; i++) cout << s[i]; cout << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n; cin >> s; if (s.size() <= n) cout << s << endl; else if (s.size() > n) { for (int i = 0; i < n; i++) cout << s[i]; cout << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
87
#include <bits/stdc++.h> using namespace std; int main(void) { int K; string S; cin >> K >> S; if (S.size() < K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { int K; string S; cin >> K >> S; if (S.size() <= K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
66
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.length() < K) { cout << S << endl; } else { cout << S.substr(0, K) + "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.length() <= K) { cout << S << endl; } else { cout << S.substr(0, K) + "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
65
K=input() S=input() K=int(K) S=str(S) longS=len(S) if longS <= K : print(S) else: head=S[0] print(head + "...")
K=input() S=input() K=int(K) S=str(S) longS=len(S) if longS <= K : print(S) else: head=S[0:K] print(head + "...")
[["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 102], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 22]]
5
53
k = int(input()) s = str(input()) if len(s)>k: print(s[0:k],"...") else: print(s)
k = int(input()) s = str(input()) if len(s)>k: print(s[0:k]+"...") else: print(s)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
43
function Main(input) { input = input.split("\n"); var K = parseInt(input[0]); var S = input[1]; if (S.length <= K) { var ans = S; } else { var ans = S.substr(0, 7) + "..."; } console.log('%s', ans); return ans; } function debug(n) { var input = document.getElementById("input" + n).value; v...
function Main(input) { input = input.split("\n"); var K = parseInt(input[0]); var S = input[1]; if (S.length <= K) { var ans = S; } else { var ans = S.substr(0, K) + "..."; } console.log('%s', ans); return ans; } function debug(n) { var input = document.getElementById("input" + n).value; v...
[["-", 0, 200, 51, 16, 31, 2, 3, 3, 0, 555], ["+", 0, 200, 51, 16, 31, 2, 3, 3, 0, 22]]
2
194
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) cout << s << endl; else { string p = s.substr(0, k); cout << s + p << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) cout << s << endl; else { string p = s.substr(0, k); cout << p + "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 0, 16, 31, 16, 12, 16, 12, 5, 0, 62], ["+", 0, 16, 31, 16, 12, 16, 12, 5, 0, 6]]
1
65
K = input() K = int(K) S = input() if len(S) >= K: print(S[:K] + "...") else: print(S)
K = input() K = int(K) S = input() if len(S) > K: print(S[:K] + "...") else: print(S)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
42
#include <bits/stdc++.h> int main() { int num_mozi = 0; std::cin >> num_mozi; std::string a; std::cin >> a; if (a.length() > num_mozi) { a = a.substr(num_mozi); a += "..."; } std::cout << a; return 0; }
#include <bits/stdc++.h> int main() { int num_mozi = 0; std::cin >> num_mozi; std::string a; std::cin >> a; if (a.length() > num_mozi) { a = a.substr(0, num_mozi); a += "..."; } std::cout << a; return 0; }
[["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21]]
1
66
#include <iostream> #include <string> using namespace std; int main(void) { int a; int b; cin >> a; string str; cin >> str; b = str.size(); if (b <= a) { cout << str << endl; } else { str = str.substr(0, a); cout << str << '...' << endl; } }
#include <iostream> #include <string> using namespace std; int main(void) { int a; int b; cin >> a; string str; cin >> str; b = str.size(); if (b <= a) { cout << str << endl; } else { str = str.substr(0, a); cout << str << "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 103, 0, 104], ["-", 0, 1, 0, 16, 31, 16, 12, 103, 0, 125], ["-", 0, 16, 31, 16, 12, 103, 0, 42, 0, 131], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
80
// // main.c // AtCoderProblems // // Created by Gaska Wojtek on 2020/05/21. // Copyright © 2020 Gaska Wojtek. All rights reserved. // #include <stdio.h> #include <stdlib.h> #include <string.h> void InsertDots(char *inputString, int *inputK) { char *outputString = malloc(10 * sizeof(char)); char *dotString = ...
#include <stdio.h> #include <stdlib.h> #include <string.h> void InsertDots(char *inputString, int *inputK) { char *outputString = malloc(255 * sizeof(char)); char *dotString = "..."; strncpy(outputString, inputString, *inputK); strcat(outputString, dotString); printf("%s \n", outputString); } void CheckL...
[["-", 49, 50, 51, 2, 3, 4, 0, 16, 31, 13], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 31, 13]]
0
259
K = int(input()) S = input() s = len(S) if s <= K: print(S) else: print(S[:K+1]+'...')
K = int(input()) S = input() s = len(S) if s <= K: print(S) else: print(S[:K]+'...')
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
44
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int a; a = s.size(); if (a <= k) { cout << s; } else { cout << s[0] << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int a; a = s.size(); if (a <= k) { cout << s; } else { cout << s.substr(0, k) << "..." << endl; } return 0; }
[["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 31, 16, 31, 16, 12, 2, 63, 118, 17, 131], ["+", 31, 16, 31, 16, 12, 2, 63, 118, 119, 120], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["-", 31, 16, 31, 16, 12, 69, 341, 342, 0, 73], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22...
1
68
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; if (k > s.size()) cout << s; else cout << s.substr(0, k) << "..."; }
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; if (k >= s.size()) cout << s; else cout << s.substr(0, k) << "..."; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
54
#include <iostream> #include <string> int main() { size_t K; std::string S; std::cin >> K >> S; const size_t length = S.length(); if (length < K) { std::cout << S << std::endl; } else { std::cout << S.substr(0, K) << "..." << std::endl; } return 0; }
#include <iostream> #include <string> int main() { size_t K; std::string S; std::cin >> K >> S; const size_t length = S.length(); if (length <= K) { std::cout << S << std::endl; } else { std::cout << S.substr(0, K) << "..." << std::endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
81
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #define Read_Fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(...
#include <algorithm> #include <bits/stdc++.h> #include <iostream> #define Read_Fast \ ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
170
#include <bits/stdc++.h> using namespace std; int main() { int t; string s; cin >> t; getline(cin, s); if (t >= (int)s.size()) { cout << s; } else { for (int i = 0; i < t; i++) { cout << s[i] << ""; } cout << "..."; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; string s; cin >> t; cin >> s; if (t >= (int)s.size()) { cout << s; } else { for (int i = 0; i < t; i++) { cout << s[i] << ""; } cout << "..."; } }
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 25]]
1
83
#!/usr/bin/env python3 # atcoder # Türkçe konuşyorum # Türkler var mı # memnün oldum K = int(input()) S = input() if(len(S) <= K): print(S) else: print(S[K:] + '.' * 3)
#!/usr/bin/env python3 # atcoder # Türkçe konuşyorum # Türkler var mı # memnün oldum K = int(input()) S = input() if(len(S) <= K): print(S) else: print(S[:K] + '.' * 3) #for i in range(3): # change = change.replace(change[i], '.') #print(S[:K] + change[:3])
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
48
#include <bits/stdc++.h> using namespace std; /** ******************* Author:Bisnu sarkar **************************** **/ /* #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") */ #define fRead(x) freopen(x, "r", stdin) #define fWrite(x) freopen(x, "w", stdout) #defin...
#include <bits/stdc++.h> using namespace std; /** ******************* Author:Bisnu sarkar **************************** **/ /* #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") */ #define fRead(x) freopen(x, "r", stdin) #define fWrite(x) freopen(x, "w", stdout) #defin...
[["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151]]
1
582
#include <iostream> #include <string.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int p = s.size(); if (p <= k) { cout << s << endl; } else { cout << s.substr(0, k - 1) << "..." << endl; } return 0; }
#include <iostream> #include <string.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int p = s.size(); if (p <= k) { cout << s << endl; } else { cout << s.substr(0, k) << "..." << endl; } return 0; }
[["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
76
#include <bits/stdc++.h> #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 INF 2e9 #define ALL(v) v.begin(), v.end() const char newl = '\n'; using namespace std; using ll = long long; auto main() -> int { cin.tie(...
#include <bits/stdc++.h> #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 INF 2e9 #define ALL(v) v.begin(), v.end() const char newl = '\n'; using namespace std; using ll = long long; auto main() -> int { cin.tie(...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
128
a = int(input()) s = input() if(len(s) > a): print(s +"...") else: print(s)
a = int(input()) s = input() if(len(s) > a): print(s[:a] +"...") else: print(s)
[["+", 0, 652, 3, 4, 0, 657, 31, 206, 0, 70], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 102], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 206, 0, 73]]
5
37
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int k; string s; cin >> k >> s; if (s.size() < k) cout << s << endl; else { rep(i, k) { cout << s.at(i); } cout << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int k; string s; cin >> k >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) { cout << s.at(i); } cout << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
79
n=int(input()) s=input() l=len(s) if l>n: print(s[:n].join('...')) else: print(s)
n=int(input()) s=input() l=len(s) if l>n: print(s[:n]+'...') else: print(s)
[["-", 0, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["-", 0, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
45
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String str = sc.next(); if (num >= str.length()) { System.out.println(str); } else { System.out.println(str.substring(0, num)); } } }
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String str = sc.next(); if (num >= str.length()) { System.out.println(str); } else { System.out.println(str.substring(0, num) + "..."); ...
[["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 62], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 491]]
3
93
#include <bits/stdc++.h> using namespace std; int main() { string S; int K, strsize; cin >> K >> S; strsize = S.size(); if (K < strsize) { int i = 0; while (i == K) { cout << S.at(i); i++; } cout << "..."; } else { cout << S; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; int K, strsize; cin >> K >> S; strsize = S.size(); if (K < strsize) { int i = 0; while (i < K) { cout << S.at(i); i++; } cout << "..."; } else { cout << S; } }
[["-", 64, 9, 0, 52, 15, 339, 51, 16, 17, 60], ["+", 64, 9, 0, 52, 15, 339, 51, 16, 17, 18]]
1
80
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> #define rep(i, n) for (ll i = 0; i < (n); i++) typedef long long ll; using namespace std; int main() { int k; string s; cin >> k >> s; if (s.le...
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <vector> #define rep(i, n) for (ll i = 0; i < (n); i++) typedef long long ll; using namespace std; int main() { int k; string s; cin >> k >> s; if (s.le...
[["+", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
94
<?php fscanf(STDIN, "%d", $k); fscanf(STDIN, "%s", $s); if(strlen($s) <= $k){ echo $s; } else { echo substr($s, 0, $k)."…"; } ?>
<?php fscanf(STDIN, "%d", $k); fscanf(STDIN, "%s", $s); if(strlen($s) <= $k){ echo $s; } else { echo substr($s, 0, $k)."..."; } ?>
[["-", 8, 9, 0, 608, 0, 16, 12, 609, 0, 610], ["+", 8, 9, 0, 608, 0, 16, 12, 609, 0, 610]]
6
62
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int length = s.length(); if (length == k) cout << s; else { s.resize(k); s = s + "..."; cout << s; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int length = s.length(); // cout<<length<<"\n"; if (length <= k) cout << s; else { s.resize(k); s = s + "..."; cout << s; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
70
def solve(): n = len(s) if n <= k: print(s) else: print(s[:n] + "...") return #n, m = [int(ii) for ii in raw_input().split()] k = int(input()) s = input() solve()
def solve(): n = len(s) if n <= k: print(s) else: print(s[:k] + "...") return #n, m = [int(ii) for ii in raw_input().split()] k = int(input()) s = input() solve()
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
52
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() < k) { cout << s << endl; return 0; } else { cout << s.substr(0, k); cout << "..." << endl; return 0; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) { cout << s << endl; return 0; } else { cout << s.substr(0, k); cout << "..." << endl; return 0; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
72
# -*- coding: utf-8 -*- S=int(input()) K=input() if(len(K)>=S): print(K[0:S]+"...") else: print(K)
# -*- coding: utf-8 -*- S=int(input()) K=input() if(len(K)>S): print(K[0:S]+"...") else: print(K)
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; if (S.size() < K - 1) cout << S << endl; else cout << S.substr(0, K) << "..." << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) cout << S << endl; else cout << S.substr(0, K) << "..." << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
62
import sys #a = [] #for l in sys.stdin: # a.append(int(l)) k = int(input()) s = input() if len(s) <= k: print(s) else: for i in range(k): print(s[i], end="") for i in range(len(s) - k): print('.', end="")
import sys #a = [] #for l in sys.stdin: # a.append(int(l)) k = int(input()) s = input() if len(s) <= k: print(s) else: for i in range(k): print(s[i], end="") for i in range(3): print('.', end="")
[["-", 12, 652, 3, 4, 0, 657, 31, 652, 63, 22], ["-", 3, 4, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 3, 4, 0, 657, 31, 652, 3, 4, 0, 22], ["-", 3, 4, 0, 657, 31, 652, 3, 4, 0, 25], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 22], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
76
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vb = vector<bool>; using vs = vector<string>; using vvi = vector<vi>; using vp = vector<pii>; #define pb push_back #define mp make_pair #define fi first #define se second #define sz(x) (int)((x)...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<int, int>; using vi = vector<int>; using vb = vector<bool>; using vs = vector<string>; using vvi = vector<vi>; using vp = vector<pii>; #define pb push_back #define mp make_pair #define fi first #define se second #define sz(x) (int)((x)...
[["-", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 112, 51, 59], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
587
#include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k; cin >> s; string str; if (s.length() <= k) { str = s; } else { str = s.substr(0, k); } cout << str << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k; cin >> s; string str; if (s.length() <= k) { str = s; } else { str = s.substr(0, k) + "..."; } cout << str << endl; return 0; }
[["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6]]
1
70
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { FastReader sc = new FastReader(); int k = sc.nextInt(); String str = sc.next(); int n = str.length(); if (n...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { FastReader sc = new FastReader(); int k = sc.nextInt(); String str = sc.next(); int n = str.length(); if (n...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
301
k = gets.to_i s = gets if s.size <= k puts s else puts s[0,k] + '...' end
k = gets.to_i s = gets.chomp if s.size <= k puts s else puts s[0,k] + '...' end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
29
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (K > (int)S.size()) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (K >= (int)S.size()) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
65
k = gets.to_i s = gets if s.size < k puts s else puts "#{s[0..k-1]}..." end
k = gets.to_i s = gets.chomp if s.size <= k puts s else puts "#{s[0..k-1]}..." end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 121, 15, 738, 17, 18], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 19]]
4
32
#include <bits/stdc++.h> #include <string.h> using namespace std; int main() { string s; int k; cin >> k >> s; if (k >= s.length()) cout << s << endl; else { string ss = ""; ss = s.substr(0, k); s += ss; cout << s << endl; } return 0; }
#include <bits/stdc++.h> #include <string.h> using namespace std; int main() { string s; int k; cin >> k >> s; if (k >= s.length()) cout << s << endl; else { string ss = ""; ss = s.substr(0, k); ss += "..."; cout << ss << endl; } return 0; }
[["-", 75, 76, 0, 9, 0, 1, 0, 11, 31, 22], ["-", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 75, 76, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
75
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define pb push_back #define gcd __gcd #define MOD 1000000007 #define mod2 998244353 #define PI 3.141592653589793238462643383279 #define forz(i, n) for (long long int i = 0; i < n; i++) int main() { ios_base::sync_with_stdio(false); cin.tie(...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define pb push_back #define gcd __gcd #define MOD 1000000007 #define mod2 998244353 #define PI 3.141592653589793238462643383279 #define forz(i, n) for (long long int i = 0; i < n; i++) int main() { ios_base::sync_with_stdio(false); cin.tie(...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
165
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int l = s.length(); if (k <= l) cout << s; else cout << s.substr(0, k) << "..."; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int l = s.length(); // cout<<l<<endl; if (k >= l) cout << s; else cout << s.substr(0, k) << "..."; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
59
#include <iostream> #include <map> #include <math.h> #include <stdio.h> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (s.size() > k) { s = s.substr(0, k - 1) + "..."; } cout << s; }
#include <iostream> #include <map> #include <math.h> #include <stdio.h> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (s.size() > k) { s = s.substr(0, k) + "..."; } cout << s; }
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
65
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { long K, N, M, X, max = 0, cnt = 0; string S; cin >> K >> S; M = S.size(); if (M < K) { cout << S; } else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..."; } }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { long K, N, M, X, max = 0, cnt = 0; string S; cin >> K >> S; M = S.size(); if (M <= K) { cout << S; } else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
94
#include <bits/stdc++.h>; #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int size; string inp; cin >> size >> inp; if (inp.size() <= size) cout << inp; else { inp.erase(size); cout << inp; } return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int size; string inp; cin >> size >> inp; if (inp.size() <= size) cout << inp; else { inp.erase(size); cout << inp << "..."; } return 0; }
[["-", 36, 36, 36, 36, 0, 30, 0, 42, 0, 35], ["+", 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, 6]]
1
64
k = int(input('')) s = str(input('')) while not 1 <= k <= 100: print('out of range! enter again') k = int(input('')) while not s.islower(): print('must be lowercase! enter again') s = str(input('')) if k > len(s): print(s) else: out = s[:k] + '...' print(out)
k = int(input('')) s = str(input('')) while not 1 <= k <= 100: print('out of range! enter again') k = int(input('')) while not s.islower(): print('must be lowercase! enter again') s = str(input('')) if k >= len(s): print(s) else: out = s[:k] + '...' print(out)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
97
K = int(input()) S = input() L = len(S) if K <= L: print(S[0:K]+"...") else: print(S)
K = int(input()) S = input() L = len(S) if K < L: print(S[0:K]+"...") else: print(S)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]]
5
43
K = int(input()) S = input() if len(S) < K: print(S) elif len(S) > K: # K = K-1 print(S[:K] + "...")
K = int(input()) S = input() if len(S) <= K: print(S) elif len(S) > K: # K = K-1 print(S[:K] + "...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
46
def main(): K = int(input()) S = input() ans = S if len(S) <= K else S[:K + 1] + "..." print(ans) if __name__ == "__main__": main()
def main(): K = int(input()) S = input() ans = S if len(S) <= K else S[:K] + "..." print(ans) if __name__ == "__main__": main()
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
54
x = input() y = input() z = len(y) if z <= int(x): print(y) else: print(y[:int(x)])
x = input() y = input() z = len(y) if z <= int(x): print(y) else: print(y[:int(x)]+'...')
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 655]]
5
41
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; if (s.size() >= n) { cout << s << "\n"; } else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "...\n"; } }
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; if (s.size() <= n) { cout << s << "\n"; } else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "...\n"; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
79
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int K; string S; cin >> K >> S; int S_len = S.size(); if (S_len <= K) { cout << "S" << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { int K; string S; cin >> K >> S; int S_len = S.size(); if (S_len <= K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62]]
1
77
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES #include <cmath> // long long mod=180143987779; // vector<long long > t(4*100001); // long long gcd(long long a,long long b) // { // if(b>a) // { // return gcd(b,a); // } // if(b==0) // { // return a; // } // else // { // ...
#include <bits/stdc++.h> using namespace std; #define _USE_MATH_DEFINES #include <cmath> // long long mod=180143987779; // vector<long long > t(4*100001); // long long gcd(long long a,long long b) // { // if(b>a) // { // return gcd(b,a); // } // if(b==0) // { // return a; // } // else // { // ...
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94]]
1
320
// 2020-05-18 #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; string s, a; cin >> s; for (int i = 0; i < min((int)s.length(), n); i++) { a += s.at(i); } cout << s; if (s.length() ...
// 2020-05-18 #include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; string s, a; cin >> s; for (int i = 0; i < min((int)s.length(), n); i++) { a += s.at(i); } cout << a; if (s.length() ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
107
#include <iostream> using namespace std; int main() { int n; cin >> n; string a; cin >> a; if (a.length() > n) { for (int i = 0; i <= n; i++) { cout << a[i]; } cout << "..."; } else { cout << a; } return 0; }
#include <iostream> using namespace std; int main() { int n; cin >> n; string a; cin >> a; if (a.length() > n) { for (int i = 0; i < n; i++) { cout << a[i]; } cout << "..."; } else { cout << a; } return 0; }
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.length() <= k) cout << s; else { cout << s.substr(0, k); } }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.length() <= k) cout << s; else { cout << s.substr(0, k) + "..."; } }
[["+", 0, 9, 0, 1, 0, 16, 12, 16, 17, 72], ["+", 0, 1, 0, 16, 12, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 16, 12, 16, 12, 5, 0, 6]]
1
52
// // ROIGold.cpp // Main calisma // // Created by Rakhman on 05/02/2019. // Copyright © 2019 Rakhman. All rights reserved. // #include <algorithm> #include <bitset> #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip>...
// // ROIGold.cpp // Main calisma // // Created by Rakhman on 05/02/2019. // Copyright © 2019 Rakhman. All rights reserved. // #include <algorithm> #include <bitset> #include <cassert> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip>...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
258
#include <stdio.h> #include <string.h> int main(void) { int k, i, slen; char s[101]; scanf("%d", k); scanf("%s", s); slen = strlen(s); for (i = 0; i <= slen && i <= k; i++) { printf("%c", s[i]); } if (slen < k) { printf("...\n"); } else { printf("\n"); } }
#include <stdio.h> #include <string.h> int main(void) { int k, i, slen; char s[101]; scanf("%d", &k); scanf("%s", &s); slen = strlen(s); for (i = 0; i < slen && i < k; i++) { printf("%c", s[i]); } if (slen > k) { printf("...\n"); } else { printf("\n"); } }
[["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["-", 8, 9, 0, 7, 15, 16, 31, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 31, 16, 17, 18], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 19], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 18], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]]
0
106
#include <bits/stdc++.h> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (s.length() == k) { cout << s; } else if (s.length() > k) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (s.length() <= k) { cout << s; } else if (s.length() > k) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
89
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; string S; cin >> S; size_t size = S.size(); if (K >= size) { cout << S << endl; } else { cout << S.substr(0, K - 1) << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; string S; cin >> S; size_t size = S.size(); if (K >= size) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } return 0; }
[["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
74
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <vector> // author:Swastik Banerjee using namespace std; typedef long long ll; #define MOD 1000000007 int main() { ios_base::sy...
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <set> #include <stack> #include <string> #include <vector> // author:Swastik Banerjee using namespace std; typedef long long ll; #define MOD 1000000007 int main() { ios_base::sy...
[["+", 0, 7, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 16, 17, 151]]
1
113
#include <bits/stdc++.h> using namespace std; int main() { string S; int K; cin >> K >> S; string res = S.substr(0, K); if (S.size() < K) res.append("..."); cout << res; }
#include <bits/stdc++.h> using namespace std; int main() { string S; int K; cin >> K >> S; string res = S.substr(0, K); if (S.size() > K) res.append("..."); cout << res; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
59
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)n; ++i) using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int K; string S; cin >> K >> S; if (S.length() <= K) cout << S << endl; else { REP(i, S.length()) cout << S[i]; cout << "..." << endl; ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (int)n; ++i) using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int K; string S; cin >> K >> S; if (S.length() <= K) cout << S << endl; else { REP(i, K) cout << S[i]; cout << "..." << endl; } }
[["-", 31, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["-", 31, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["-", 31, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 0, 1, 0, 16, 31, 2, 3, 4, 0, 22]]
1
90
#include <iostream> using namespace std; int main() { int K; string S; cin >> K >> S; int Q = S.size(); if (Q < K) { cout << S << endl; } else { string ans = S.substr(0, K); cout << ans << "..." << endl; } }
#include <iostream> using namespace std; int main() { int K; string S; cin >> K >> S; int Q = S.size(); if (Q <= K) { cout << S << endl; } else { string ans = S.substr(0, K); cout << ans << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
72
K = int(input()) S = input() if K <= len(S): print(S) else: print(S[:K]+"...")
K = int(input()) S = input() if K >= len(S): print(S) else: print(S[:K]+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
39
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long k = sc.nextLong(); String s = sc.next(); long len = s.length(); if (len <= k) System.out.println(s); else { for (int i = 0; i < k; i++) System.out.print(s.cha...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long k = sc.nextLong(); String s = sc.next(); long len = s.length(); if (len <= k) System.out.println(s); else { for (int i = 0; i < k; i++) System.out.print(s.cha...
[["-", 0, 195, 8, 196, 0, 57, 75, 196, 0, 46], ["+", 0, 195, 8, 196, 0, 57, 75, 196, 0, 46]]
3
118
#include <bits/stdc++.h> using namespace std; #define ll long long typedef vector<int> vi; typedef pair<int, int> pi; #define SQ(a) (a) * (a) #define deb(x) cout << #x << " = " << x << '\n' #define deb2(x, y) \ cout << "(" << #x << ", " << #y << ") = (" << x...
#include <bits/stdc++.h> using namespace std; #define ll long long typedef vector<int> vi; typedef pair<int, int> pi; #define SQ(a) (a) * (a) #define deb(x) cout << #x << " = " << x << '\n' #define deb2(x, y) \ cout << "(" << #x << ", " << #y << ") = (" << x...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
158