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
# -*- coding: utf-8 -*- """ Created on Sat May 30 16:59:03 2020 @author: Tofu """ def tran(N,string): #print(N) #print(string) if len(string) > N: strout = string[:N]+'...' return strout else: return string if __name__ == '__main__': N = int(input()) string = input() ...
# -*- coding: utf-8 -*- """ Created on Sat May 30 16:59:03 2020 @author: Tofu """ def tran(N,string): #print(N) #print(string) if len(string) > N: strout = string[:N]+'...' return strout else: return string if __name__ == '__main__': N = int(input()) string = input() ...
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
67
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int n = s.length(); if (n <= k) System.out.println(s); else { System.out.println(s.substring(0, k + 1) + "..."); } } }
import java.util.*; class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int n = s.length(); if (n <= k) System.out.println(s); else { System.out.println(s.substring(0, k) + "..."); } } }
[["-", 0, 16, 31, 492, 3, 4, 0, 16, 17, 72], ["-", 0, 16, 31, 492, 3, 4, 0, 16, 12, 499]]
3
101
#include <iostream> #include <string> using namespace std; int main() { int n, l, i; cin >> n; string s; cin >> s; if (s.size() == n) cout << s; else { for (i = 0; i < n; i++) { cout << s[i]; } cout << "..."; } }
#include <iostream> #include <string> using namespace std; int main() { int n, l, i; cin >> n; string s; cin >> s; if (s.size() <= n) cout << s; else { for (i = 0; i < n; i++) { cout << s[i]; } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
77
k = int(input()) s = input() length = len(s) if length > K: s = s[:K]+"..." print(s)
k = int(input()) s = input() length = len(s) if length > k: s = s[:k]+"..." print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22], ["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22]]
5
39
K = input() S = input() if len(S) <= int(K): print(S) else: print(S[0:int(K)])
K = input() S = input() if len(S) <= int(K): print(S) else: print(S[0:int(K)] +'...')
[["+", 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
39
K = int(input()) S = input() if (len(S) <= K): print(S) else: print(S[0:K-1] + "...")
K = int(input()) S = input() if (len(S) <= K): print(S) else: print(S[0:K] + "...")
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
44
// by Balloons #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define mpr make_pair #define debug() puts("okkkkkkkk") #define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++) using namespace std; typedef long long LL; const int inf = 1e9; signed main() { int n; scanf("%d", &n); ...
// by Balloons #include <algorithm> #include <cstdio> #include <cstring> #include <iostream> #define mpr make_pair #define debug() puts("okkkkkkkk") #define rep(i, a, b) for (int(i) = (a); (i) <= (b); (i)++) using namespace std; typedef long long LL; const int inf = 1e9; signed main() { int n; scanf("%d", &n); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
141
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int n = s.size(); if (n < k) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int n = s.size(); if (n <= k) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
81
#include <bits/stdc++.h> using namespace std; int main() { int K; string N; cin >> K; cin >> N; if (N.size() < K) { cout << N << endl; } else { cout << N.erase(K) + "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string N; cin >> K; cin >> N; if (N.size() <= K) { cout << N << endl; } else { cout << N.erase(K) + "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
62
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; if ((int)s.size() > n) cout << s.substr(0, n) << "..."; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; if ((int)s.size() > 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
57
#include <iostream> #include <string> using namespace std; int main() { int a, b; string s; cin >> b; cin >> s; a = s.length(); cout << a; if (a <= b) cout << s; else { for (int i = 0; i < b; i++) { cout << s[i]; } cout << "..."; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int a, b; string s; cin >> b; cin >> s; a = s.length(); if (a <= b) cout << s; else { for (int i = 0; i < b; i++) { cout << s[i]; } cout << "..."; } return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
87
#include <iostream> #include <string.h> #include <string> using namespace std; int main() { char a[255]; int b, i, j; char *p = NULL; cin >> b; cin >> a; i = strlen(a); p = a; j = b; if (i <= b) { cout << a << endl; } else { for (j = 0; j < b; j++) { cout << a[j]; } cout << e...
#include <iostream> #include <string.h> #include <string> using namespace std; int main() { char a[255]; int b, i, j; char *p = NULL; cin >> b; cin >> a; i = strlen(a); p = a; j = b; if (i <= b) { cout << a << endl; } else { for (j = 0; j < b; j++) { cout << a[j]; } cout << "...
[["+", 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
104
#include <stdio.h> #include <string.h> int main(void) { int k; char s[101]; scanf("%d", &k); scanf("%s", s); if (strlen(s) < k) printf("%s\n", s); else { for (int i = 0; i < k; ++i) printf("%c", s[i]); printf("...\n"); } return 0; }
#include <stdio.h> #include <string.h> int main(void) { int k; char s[110]; scanf("%d", &k); scanf("%s", s); if (strlen(s) <= k) printf("%s\n", s); else { for (int i = 0; i < k; ++i) printf("%c", s[i]); printf("...\n"); } return 0; }
[["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
98
k = int(input()) s = input() if len(s)>k: print(s[0:k],"...") else: print(s)
k = int(input()) s = input() if len(s)>k: print(s[0:k],"...",sep="") else: print(s)
[["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
5
40
limit = int(input()) string = input() if limit < len(string): ans = string[:limit] + '...' print(ans)
limit = int(input()) string = input() if limit < len(string): string = string[:limit] + '...' print(string)
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 31, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
36
K = int(input()) S = str(input()).lower() if 0 < K < 101 and 0 < len(S) < 101: if len(S) < K: print(S) else: print(S[:K] + "...") else: print("Try again with K and length of S between 1 and 100 ")
K = int(input()) S = str(input()).lower() if 0 < K < 101 and 0 < len(S) < 101: if len(S) <= K: print(S) else: print(S[:K] + "...") else: print("Try again with K and length of S between 1 and 100 ")
[["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 19]]
5
70
#include <bits/stdc++.h> using namespace std; template <class c> struct rge { c b, e; }; template <class c> rge<c> range(c i, c j) { return rge<c>{i, j}; } template <class c> auto dud(c *x) -> decltype(cerr << *x, 0); template <class c> char dud(...); struct debug { #ifdef LOCAL ~debug() { cerr << endl; } template ...
#include <bits/stdc++.h> using namespace std; template <class c> struct rge { c b, e; }; template <class c> rge<c> range(c i, c j) { return rge<c>{i, j}; } template <class c> auto dud(c *x) -> decltype(cerr << *x, 0); template <class c> char dud(...); struct debug { #ifdef LOCAL ~debug() { cerr << endl; } template ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
541
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ int main(void) { int k; cin >> k; string s; cin >> s; if (s.length() < k) { cout << s << endl; } else { s = s.substr(0, k); s += "..."; cout << s << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; using P = pair<int, int>; /* ちゃんと考えてわかって実装 */ int main(void) { int k; cin >> k; string s; cin >> s; if (s.length() <= k) { cout << s << endl; } else { s = s.substr(0, k); s += "..."; cout << s << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
90
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= k) cout << s; else { for (int i = 0; i < k; i++) cout << s[i]; cout << '...'; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= k) cout << s; else { for (int i = 0; i < k; i++) cout << s[i]; cout << "..."; } }
[["-", 0, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["-", 0, 9, 0, 1, 0, 16, 12, 103, 0, 125], ["-", 0, 1, 0, 16, 12, 103, 0, 42, 0, 131], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
72
import java.util.*; public class Main { int N; Scanner reader = new Scanner(System.in); public static void main(String[] args) { Main p = new Main(); p.run(); } public void run() { N = reader.nextInt(); String s = reader.next(); if (s.length() <= N) System.out.print(s); else ...
import java.util.*; public class Main { int N; Scanner reader = new Scanner(System.in); public static void main(String[] args) { Main p = new Main(); p.run(); } public void run() { N = reader.nextInt(); String s = reader.next(); if (s.length() <= N) System.out.print(s); else ...
[["-", 0, 16, 31, 492, 3, 4, 0, 16, 17, 72], ["-", 0, 16, 31, 492, 3, 4, 0, 16, 12, 499]]
3
118
s = [input() for i in range(2)] if len(s[1]) < int(s[0]): print(s[1]) elif len(s[1]) >= int(s[0]): print(s[1][0:int(s[0])] + '...')
s = [input() for i in range(2)] if len(s[1]) <= int(s[0]): print(s[1]) elif len(s[1]) > int(s[0]): print(s[1][0:int(s[0])] + '...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 656, 0, 57, 75, 665, 15, 666, 667, 20], ["+", 0, 656, 0, 57, 75, 665, 15, 666, 667, 47]]
5
77
/* @author: sharrad99 */ #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int k; cin >> k; string s; cin >> s; if (k > (int)s.length()) { cout << s << '\n'; } else { string res = s.substr(0, k); res += "..."; ...
/* @author: sharrad99 */ #include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int k; cin >> k; string s; cin >> s; if (k >= (int)s.length()) { cout << s << '\n'; } else { string res = s.substr(0, k); res += "..."; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
100
main(require('fs').readFileSync('/dev/stdin', 'utf8')); function main(input) { input = input.split('\n'); k = parseInt(input[0]); s = input[1]; if (s.length === k) { console.log(s); } else { console.log(s.substring(0, k) + '...'); } }
main(require('fs').readFileSync('/dev/stdin', 'utf8')); function main(input) { input = input.split('\n'); k = parseInt(input[0]); s = input[1]; if (s.length <= k) { console.log(s); } else { console.log(s.substring(0, k) + '...'); } }
[["-", 8, 556, 0, 57, 15, 23, 0, 16, 17, 565], ["+", 8, 556, 0, 57, 15, 23, 0, 16, 17, 19]]
2
94
K = int(input()) S = str(input()) if K >= S: print(S) else: print(S[:K] + '...')
K = int(input()) S = str(input()) if K >= len(S): print(S) else: print(S[:K] + '...')
[["+", 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
39
k=int(input()) s=str(input()) if len(s)>=k: s=s[:k] s+="..." print(s)
k=int(input()) s=(input()) if len(s)>k: s=s[:k] s+="..." print(s)
[["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
40
k = int(input()) s = input() if len(str(s)) <= k: print(s) else: print(s[k:] + '...')
k = int(input()) s = input() if len(str(s)) <= k: print(s) else: print(s[:k] + '...')
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
42
function Main(input) { tmp = input.split("\n"); k = parseInt(tmp[0], 10); s = tmp[1]; long = s.length; if (k >= long) { console.log(s); } else { cut = s.substr(0, k); console.log(+'...'); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) { tmp = input.split("\n"); k = parseInt(tmp[0], 10); s = tmp[1]; long = s.length; if (k >= long) { console.log(s); } else { cut = s.substr(0, k); console.log(cut + '...'); } } Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["+", 0, 1, 0, 2, 3, 3, 0, 16, 31, 22]]
2
103
n = int(input()) s = input() if len(s)<=n: print(s) else: i=0 for i in range(7): print(s[i], end='') print('...')
n = int(input()) s = input() if len(s)<=n: print(s) else: i=0 for i in range(n): print(s[i], end='') print('...')
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 22]]
5
56
# AtCoder n = int(input()) s = input() if len(s) >= n: print(f'{s[:n]}...') else: print(s)
# AtCoder n = int(input()) s = input() if len(s) > n: print(f'{s[:n]}...') else: print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
41
#include <bits/stdc++.h> using namespace std; #define ll long long #define pi pair<int, int> #define mkp make_pair #define pb push_back #define fr first #define sc second #define endl '\n' const int mxn = 1e6 + 5; const ll MOD = 1e9 + 7; int arr[mxn]; int n, m, k, q; string s, t; void solve() { cin >> k >> s; i...
#include <bits/stdc++.h> using namespace std; #define ll long long #define pi pair<int, int> #define mkp make_pair #define pb push_back #define fr first #define sc second #define endl '\n' const int mxn = 1e6 + 5; const ll MOD = 1e9 + 7; int arr[mxn]; int n, m, k, q; string s, t; void solve() { cin >> k >> s; i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
162
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num = scan.nextInt(); String str = scan.next(); scan.close(); if (str.length() < num) { System.out.println(str); } else { System.out.println(str.su...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num = scan.nextInt(); String str = scan.next(); scan.close(); if (str.length() <= num) { System.out.println(str); } else { System.out.println(str.s...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
103
#include <iostream> #define ll long long int using namespace std; int main() { string s; ll k; cin >> k; cin >> s; ll l = s.length(); if (l <= k) cout << s << endl; else { for (ll i = 0; i < k; i++) { cout << s[i]; } cout << endl; } return 0; }
#include <iostream> #define ll long long int using namespace std; int main() { string s; ll k; cin >> k; cin >> s; ll l = s.length(); if (l <= k) cout << s << endl; else { for (ll i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
[["+", 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
83
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); String[] ary = S.split(""); sc.close(); String res = ""; if (S.length() <= K) { System.out.println(S); } else {...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); String[] ary = S.split(""); sc.close(); String res = ""; if (S.length() <= K) { System.out.println(S); } else {...
[["+", 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
136
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner l = new Scanner(System.in); int length = l.nextInt(); String word = l.next(); if (word.length() > length) { String newS = word.substring(0, length); System.out.println(newS = "..."); } else ...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner l = new Scanner(System.in); int length = l.nextInt(); String word = l.next(); if (word.length() > length) { String newS = word.substring(0, length); System.out.println(newS + "..."); } else ...
[["-", 0, 1, 0, 492, 3, 4, 0, 11, 17, 32], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72]]
3
102
k = int(input()) s = input() if len(s) > k: s = s[:k] print(s)
k = int(input()) s = input() if len(s) > k: s = s[:k] + '...' print(s)
[["+", 64, 196, 0, 1, 0, 662, 12, 657, 17, 72], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 654], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 655]]
5
32
#include <iostream> #include <string> using namespace std; int main() { string str; int strNum = 0; cin >> str; cin >> strNum; if (str.size() <= strNum) { cout << str << endl; } else cout << str.erase(strNum) << "..." << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string str; int strNum = 0; cin >> strNum; cin >> str; if (str.size() <= strNum) { cout << str << endl; } else cout << str.erase(strNum) << "..." << endl; return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
67
n = int(input()) str = input() if len(str)<n: print(str) else: str = str[:n] + '...' print(str)
n = int(input()) str = input() if len(str)<=n: print(str) else: str = str[:n] + '...' print(str)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
42
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); StringBuilder sb = new StringBuilder(sc.next()); if (sb.length() <= K) { System.out.print(sb.toString()); } else { System.out.print(sb.substring(0, K - 1...
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); StringBuilder sb = new StringBuilder(sc.next()); if (sb.length() <= K) { System.out.print(sb.toString()); } else { System.out.print(sb.substring(0, K).to...
[["-", 31, 492, 500, 492, 3, 4, 0, 16, 17, 33], ["-", 31, 492, 500, 492, 3, 4, 0, 16, 12, 499]]
3
110
K = int(input()) S = input() #print(len(S)) #print(S[1:3]) if len(S) <= K : print(S) else: print(S[1:K] + "...")
K = int(input()) S = input() #print(len(S)) #print(S[1:3]) if len(S) <= K : print(S) else: print(S[0:K] + "...")
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612]]
5
42
K = int(input()) S = input() if K < len(S): S = S[0:K-1] S = S+"..." print(S)
K = int(input()) S = input() if K < len(S): S = S[0:K] S = S+"..." print(S)
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
42
# -*- coding: utf-8 -*- """ Created on Wed May 27 14:43:56 2020 @author: 17664 """ k = int(input()) s = input() if len(s) <= k: print(s + '...') else: print(s[:k] + '...')
# -*- coding: utf-8 -*- """ Created on Wed May 27 14:43:56 2020 @author: 17664 """ k = int(input()) s = input() if len(s) <= k: print(s) else: print(s[:k] + '...')
[["-", 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
47
keta = int(input()) word = str(input()) if len(word) <= keta: print(word) else: print(word[:keta-1] + "...")
keta = int(input()) word = str(input()) if len(word) <= keta: print(word) else: print(word[:keta] + "...")
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
44
function main(input) { input = input.split("\n"); let k = parseInt(input[0], 10); let s = input[1]; console.log(s.slice(0, k) + ((k <= s.length) ? "" : "...")); } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
function main(input) { input = input.split("\n"); let k = parseInt(input[0], 10); let s = input[1]; console.log(s.slice(0, k) + ((k >= s.length) ? "" : "...")); } main(require('fs').readFileSync('/dev/stdin', 'utf8'));
[["-", 12, 23, 0, 510, 15, 23, 0, 16, 17, 19], ["+", 12, 23, 0, 510, 15, 23, 0, 16, 17, 20]]
2
91
#include <stdio.h> int main() { int K, count; char S[101]; scanf("%d", &K); scanf("%s", &S); for (count = 0; S[count] |= '\0'; count++) { } if (count < K) { printf("%s", S); } else { for (int i = 0; i < K; i++) { printf("%c", S[i]); } printf("...\n"); } return 0; }
#include <stdio.h> int main() { int K, count; char S[101]; scanf("%d", &K); scanf("%s", &S); for (count = 0; S[count] |= '\0'; count++) { } if (count <= K) { printf("%s", S); } else { for (int i = 0; i < K; i++) { printf("%c", S[i]); } printf("...\n"); } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
118
k = int(input()) s = input() l = len(s) if l < k + 1: print(s) else: print(s[:k],"...")
k = int(input()) s = input() l = len(s) if l < k + 1: print(s) else: print(s[:k]+"...")
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
44
#include <bits/stdc++.h> using namespace std; int main() { // freopen("in.txt","r",stdin); // freopen("out.txt","w",stdout); int n, i = 0; string s; cin >> n; getline(cin, s); if (s.size() > n) s = s.substr(0, n) + "..."; cout << s << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { // freopen("in.txt","r",stdin); // freopen("out.txt","w",stdout); int n, i = 0; string s; cin >> n; cin >> s; if (s.size() > n) s = s.substr(0, n) + "..."; cout << s << endl; return 0; }
[["-", 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
69
import sys K = int(input()) S = input() if(len(S)<=K): print(S) else: print(S[:K])
import sys K = int(input()) S = input() if(len(S)<=K): print(S) else: print(S[:K]+"...")
[["+", 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
39
#include <iostream> #include <string> using namespace std; int main(void) { int K, len = 0; string S, str; cin >> K; cin >> S; if (K < 1 || 100 < K) return 0; len = sizeof(S); if (len < 1 || 100 < len) return 0; for (int i = 0; i < len; i++) { if (isupper(S[i])) return 0; } if (...
#include <iostream> #include <string> using namespace std; int main(void) { int K, len = 0; string S, str; cin >> K; cin >> S; if (K < 1 || 100 < K) return 0; len = S.length(); if (len < 1 || 100 < len) return 0; for (int i = 0; i < len; i++) { if (isupper(S[i])) return 0; } if ...
[["-", 8, 9, 0, 1, 0, 11, 12, 105, 0, 150], ["-", 0, 1, 0, 11, 12, 105, 51, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 63, 118, 17, 131], ["+", 0, 1, 0, 11, 12, 2, 63, 118, 119, 120], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 24]]
1
144
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define llu unsigned long long #define ll long long ll read() { ll x; if (scanf("%lld", &x) == -1) exit(0); return x; } #define vi vector<int> #define vb vector<bool> const long long INF = 5e18; #define LOCAL_J...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (a); i < (b); i++) #define llu unsigned long long #define ll long long ll read() { ll x; if (scanf("%lld", &x) == -1) exit(0); return x; } #define vi vector<int> #define vb vector<bool> const long long INF = 5e18; #define LOCAL_J...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
188
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long int LL; typedef pair<int, int> P; typedef pair...
#include <algorithm> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long int LL; typedef pair<int, int> P; typedef pair...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
415
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int k = sc.nextInt(); final String s = sc.next(); if (s.length() < k) { System.out.println(s); } else { System.out.println(s.substring(0, k) + "..."); } } }
import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int k = sc.nextInt(); final String s = sc.next(); if (s.length() <= k) { System.out.println(s); } else { System.out.println(s.substring(0, k) + "..."); } } }
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
98
def main(): K = int(input()) S = input() diff = K - len(S) if diff > 0: print(S) else: print(S[:K]+'...') if __name__ == "__main__": main()
def main(): K = int(input()) S = input() diff = K - len(S) if diff >= 0: print(S) else: print(S[:K]+'...') if __name__ == "__main__": main()
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20]]
5
59
/* ----------------------- reclone_rk * --------------------------------------------*/ #include <bits/stdc++.h> using namespace std; #define int long long int const int mod = 1e9 + 7; #define FastRead \ ios::sync_with_stdio(0); ...
/* ----------------------- reclone_rk * --------------------------------------------*/ #include <bits/stdc++.h> using namespace std; #define int long long int const int mod = 1e9 + 7; #define FastRead \ ios::sync_with_stdio(0); ...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
357
import sys import socket hostname = socket.gethostname() if hostname == 'F451C': sys.stdin = open('b1.in') def read_int_list(): return list(map(int, input().split())) def read_str_list(): return input().split() def read_int(): return int(input()) def read_str(): return input() def main()...
import sys import socket hostname = socket.gethostname() if hostname == 'F451C': sys.stdin = open('b1.in') def read_int_list(): return list(map(int, input().split())) def read_str_list(): return input().split() def read_int(): return int(input()) def read_str(): return input() def main()...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["-", 0, 662, 12, 657, 31, 206, 206, 663, 0, 612]]
5
130
k = int(input()) s = int(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)
[["-", 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], ["+", 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
38
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> typedef long long ll; #define pi 3.14159...
#include <algorithm> #include <cstdio> #include <iomanip> #include <iostream> #include <list> #include <map> #include <math.h> #include <numeric> #include <queue> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> typedef long long ll; #define pi 3.14159...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
644
#!/usr/bin/env python3 K = int(input()) S = input() if (len(S) <= K): print(S) else: print(S[0:K+1] + "...")
#!/usr/bin/env python3 K = int(input()) S = input() if (len(S) <= K): print(S) else: print(S[0:K] + "...")
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
45
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { // Taking inputs of following format. int n; cin >> n; string s; cin >> s; int len = s.length(); if (len < n) { cout << s << endl; } else { for ...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { // Taking inputs of following format. int n; cin >> n; string s; cin >> s; int len = s.length(); if (len <= n) { cout << s << endl; } else { for...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
97
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int length = sc.nextInt(); String str = sc.next(); String answer; if (str.length() <= length) { answer = str; } else { answer = str.substring(0, length); } ...
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int length = sc.nextInt(); String str = sc.next(); String answer; if (str.length() <= length) { answer = str; } else { answer = str.substring(0, length) + "...";...
[["+", 75, 196, 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, 491]]
3
94
import sys import collections input = sys.stdin.readline k = int(input()) s = input() if len(s) <= k: print(s) else: print(s[:k] + '...')
import sys import collections input = sys.stdin.readline k = int(input()) s = input().strip() if len(s) <= k: print(s) else: print(s[:k] + '...')
[["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
50
K = int(input()) S = str(input()) s = len(S) if s < K: print(S) else : print(S[0:K]+"...")
K = int(input()) S = str(input()) s = len(S) if s <= K: print(S) else : print(S[0:K]+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
46
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; int siz = s.length(); if (k < siz) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << " ..."; } else cout << s; return 0; }
#include <iostream> using namespace std; int main() { int k; string s; cin >> k >> s; int siz = s.length(); if (k < siz) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } else cout << s; return 0; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
78
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); String S = scan.next(); int x = S.length(); if (x > K) { String ans = S.substring(0, K + 1); System.out.println(ans + "..."); } else...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); String S = scan.next(); int x = S.length(); if (x > K) { String ans = S.substring(0, K); System.out.println(ans + "..."); } else { ...
[["-", 49, 200, 51, 492, 3, 4, 0, 16, 17, 72], ["-", 49, 200, 51, 492, 3, 4, 0, 16, 12, 499]]
3
109
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> /...
//インクルード(アルファベット順) #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> /...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 62], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151]]
1
242
a = input() word = input() b = len(word) if int(a) > b: print(word) else: print(word[0:int(a)] + "...")
a = input() word = input() b = len(word) if int(a) >= b: print(word) else: print(word[0:int(a)] + "...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
46
package main import "fmt" func main() { var n int fmt.Scan(&n) var s string fmt.Scan(&s) if n > len(s) { fmt.Println(s) return }else{ fmt.Println(s[:n]+"...") } }
package main import "fmt" func main() { var n int fmt.Scan(&n) var s string fmt.Scan(&s) if n >= len(s) { fmt.Println(s) return }else{ fmt.Println(s[:n]+"...") } }
[["-", 0, 435, 8, 196, 0, 57, 15, 16, 17, 47], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 17, 20]]
7
75
#include <bits/stdc++.h> using namespace std; constexpr int64_t INF = 1'010'000'000'000'000'017LL; constexpr int64_t MOD = 1'000'000'007LL; constexpr double EPS = 1e-12; constexpr double PI = 3.14159265358979323846; #define FOR(i, start, end) for (int64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) // 最大...
#include <bits/stdc++.h> using namespace std; constexpr int64_t INF = 1'010'000'000'000'000'017LL; constexpr int64_t MOD = 1'000'000'007LL; constexpr double EPS = 1e-12; constexpr double PI = 3.14159265358979323846; #define FOR(i, start, end) for (int64_t i = start; i < end; i++) #define REP(i, n) FOR(i, 0, n) // 最大...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
301
#include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k; cin >> s; int s_len = s.length(); string s_part = s.substr(1, k); if (s_len <= k) { cout << s << endl; } else { cout << s_part << "..." << endl; } }
#include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k; cin >> s; int s_len = s.length(); string s_part = s.substr(0, k); if (s_len <= k) { cout << s << endl; } else { cout << s_part << "..." << endl; } }
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13]]
1
76
#include <stdio.h> #include <string.h> int main(void) { int k, n, i; char s[100]; scanf("%d", &k); scanf("%s", &s); n = strlen(s); if (n <= k) printf("%s\n", s); else if (n > k) { for (i = 1; i <= k; i++) { printf("%c", s[i]); } printf("...\n"); } return 0; }
#include <stdio.h> #include <string.h> int main(void) { int k, n, i; char s[100]; scanf("%d", &k); scanf("%s", &s); n = strlen(s); if (n <= k) printf("%s\n", s); else if (n > k) { for (i = 0; i < k; i++) { printf("%c", s[i]); } printf("...\n"); } return 0; }
[["-", 0, 57, 64, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 57, 64, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18]]
0
114
#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 { for (int i = 0; i < k; i++) { cout << s.at(i); if (i = k - 1) cout << "..." << 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 { for (int i = 0; i < k; i++) { cout << s.at(i); if (i == k - 1) cout << "..." << endl; } } }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
86
K = int(input()) S = input() S_len = len(S) if S_len < K: print(S) else: print(S[:K] + "...")
K = int(input()) S = input() S_len = len(S) if S_len <= K: print(S) else: print(S[:K] + "...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
42
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int k; cin >> k; string s; cin >> s; if (s.size() < k) { cout << s << endl; } else { cout << s.substr(0, k) + "..." << endl; } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int k; cin >> k; string s; 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]]
1
78
k = int(input()) s = input() if k > len(s): print(s) else: print("{}...".format(s[:k]))
k = int(input()) s = input() if k >= len(s): print(s) else: print("{}...".format(s[:k]))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
42
<?php $k = fgets(STDIN); $s = fgets(STDIN); if ($k >= strlen($s)) { echo $s; } else { echo substr($s,0,$k). '...'; } ?>
<?php $k = fgets(STDIN); $s = trim(fgets(STDIN)); if ($k >= strlen($s)) { echo $s; } else { echo substr($s,0,$k). '...'; } ?>
[["+", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["+", 3, 3, 0, 28, 0, 613, 3, 3, 0, 25]]
6
54
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() == K) { 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 (S.size() <= K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
62
#include <iostream> #include <string> using namespace std; int main() { int K; string S; cin >> K >> S; int n; n = S.size(); if (n <= K) { cout << S << endl; } else { cout << S.substr(1, K) << "..." << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int K; string S; cin >> K >> S; int n; n = S.size(); if (n <= K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } return 0; }
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13]]
1
74
#include <bits/stdc++.h> using namespace std; #define ll long long #define sci(x) scanf("%d", &x) #define scl(x) scanf("%lld", &x) #define scd(x) scanf("%lf", &x) #define l0(i, n) for (ll i = 0; i < n; i++) int main() { ios::sync_with_stdio(0); cin.tie(0); // CODE TONOY ll n; cin >> n; string s; cin >> s...
#include <bits/stdc++.h> using namespace std; #define ll long long #define sci(x) scanf("%d", &x) #define scl(x) scanf("%lld", &x) #define scd(x) scanf("%lf", &x) #define l0(i, n) for (ll i = 0; i < n; i++) int main() { ios::sync_with_stdio(0); cin.tie(0); // CODE TONOY ll n; cin >> n; string s; cin >> s...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
139
#include <iostream> #include <string> using namespace std; int main() { string s; int k; cin >> s; cin >> k; if (s.size() <= k) { cout << s << endl; } else { string a = s.substr(0, k); a += "..."; cout << a << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (s.size() <= k) { cout << s << endl; } else { string a = s.substr(0, k); a += "..."; cout << a << endl; } return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
76
#include <bits/stdc++.h> using namespace std; int main() { string S; int K; cin >> K; cin >> S; if (S.size() <= K) { cout << S << endl; return 0; } else { 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.size() <= K) { cout << S << endl; return 0; } else { for (int i = 0; i < K; i++) { cout << S[i]; } } cout << "..." << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
84
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int x, len; int i; if (scanf("%d\n", &x) == EOF) return -1; char s[100]; if (scanf(s, 100, stdin) == EOF) return -1; len = strlen(s); if (len <= x) { printf("%s\n", s); } else { for (i = 0; i < x; i++) printf...
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int x, len; int i; if (scanf("%d\n", &x) == EOF) return -1; char s[100]; if (scanf("%s", s) == EOF) return -1; len = strlen(s); if (len <= x) { printf("%s\n", s); } else { for (i = 0; i < x; i++) printf("%c",...
[["-", 15, 23, 0, 16, 31, 2, 3, 4, 0, 22], ["-", 15, 23, 0, 16, 31, 2, 3, 4, 0, 21], ["-", 15, 23, 0, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 16, 31, 2, 3, 4, 0, 5, 0, 6], ["+", 15, 23, 0, 16, 31, 2, 3, 4, 0, 22]]
0
124
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int len = s.length(); if (len <= k) { System.out.println(s); } else { char[] a = s.toCharArray(); for (int ...
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int len = s.length(); if (len <= k) { System.out.println(s); } else { char[] a = s.toCharArray(); for (int ...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
132
K=int(input()) S=input() s=list(S) if len(s) < K: print(S) else: print(s[0:(K-1):]+"...")
K=int(input()) S=input() s=list(S) if len(s) <= K: print(S) else: print(S[0:K:]+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 0, 652, 3, 4, 0, 657, 31, 206, 51, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 206, 51, 22], ["-", 0, 657, 31, 206, 206, 663, 0, 23, 0, 24], ["-", 31, 206, 206, 663, 0, 23, 0, 657, 17, 33], ["-", 31, 206, 206, 663, 0, 23, 0,...
5
51
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int a = S.size(); string t = ""; char c; if (a <= K) cout << "S" << endl; else { for (int i = 0; i < K; i++) { c = S.at(i); t = t + c; } cout << t + "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int a = S.size(); string t = ""; char c; if (a <= K) cout << S << endl; else { for (int i = 0; i < K; i++) { c = S.at(i); t = t + c; } cout << t + "..." << endl; } }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 62]]
1
100
#include <algorithm> #include <iostream> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { int K, len; string S; cin >> K >> S; len = S.length(); if (K > len) { cout << S << endl; } else { S.replace(K, len - K, "..."); cout << S << endl; } return 0...
#include <algorithm> #include <iostream> #include <stdlib.h> #include <string> #include <vector> using namespace std; int main() { int K, len; string S; cin >> K >> S; len = S.length(); if (K >= len) { cout << S << endl; } else { S.replace(K, len - K, "..."); cout << S << endl; } return ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
83
K = input() K = int(K) S = input() if len(S) <= K: print(S) else: print(S[:K], '...')
K = input() K = int(K) S = input() if len(S) <= K: print(S) else: print(f'{S[:K]}...')
[["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 557, 0, 284, 0, 45], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 557, 0, 284, 0, 46]]
5
42
K=int(input("")) S=input("") lenS=len(S) if lenS<=K: print(S) else: print(S[:K])
K=int(input("")) S=input("") lenS=len(S) if lenS<=K: print(S) else: print(S[:K]+"...")
[["+", 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
42
#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, 7) << "..." << endl; } }
#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; } }
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
62
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() > k) { s.substr(0, k) + "..."; } cout << s; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() > k) { s = s.substr(0, k) + "..."; } cout << s; return 0; }
[["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 11, 12, 16, 31, 2, 63, 118, 28, 22]]
1
58
import java.io.*; import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.nextLine(); if (s.length() <= k) { System.out.println(s); } else { System.ou...
import java.io.*; import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(sc.nextLine()); String s = sc.nextLine(); if (s.length() <= k) { System.out.println(s); } els...
[["+", 8, 196, 0, 503, 49, 200, 51, 492, 500, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 0, 131], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 24], ["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 49, 200, 51, 492, 3, 4, 0, 492, 141, 22], ["+", 51, 492, 3, 4, 0, 49...
3
113
#include <iostream> #include <string> int main() { int K; std::string S; std::cin >> K; std::cin >> S; int s_size = (int)S.size(); int flag = 0; if (s_size < K) { K = s_size; } else { flag = 1; } for (int i = 0; i < K; i++) { std::cout << S[i]; } if (flag == 1) { std::cout << "...
#include <iostream> #include <string> int main() { int K; std::string S; std::cin >> K; std::cin >> S; int s_size = (int)S.size(); int flag = 0; if (s_size <= K) { K = s_size; } else { flag = 1; } for (int i = 0; i < K; i++) { std::cout << S[i]; } if (flag == 1) { std::cout << ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
115
k=int(input()) s=input() n=len(s) if k>=n: print(s) else: ans ="" for i in range(k): ans+=s[i] s+="..." print(s)
k=int(input()) s=input() n=len(s) if k>=n: print(s) else: ans ="" for i in range(k): ans+=s[i] ans+="..." print(ans)
[["-", 75, 76, 8, 196, 0, 1, 0, 677, 31, 22], ["+", 75, 76, 8, 196, 0, 1, 0, 677, 31, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
57
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll K; string S; cin >> K >> S; if (S.size() == K) { cout << S << endl; } else { cout << S.substr(0, K) <...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { ll K; string S; cin >> K >> S; if (S.size() <= K) { cout << S << endl; } else { cout << S.substr(0, K) <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
81
n=int(input()) arr=input() z=len(arr) if z<=n: print(arr) else: print(arr[:n],"...")
n=int(input()) arr=input() z=len(arr) if z<=n: print(arr) else: print(arr[:n]+"...")
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]]
5
42
k = input() s = input() k = int(k) if len(s) <= k: print(s) else: print(s[0:k],"...")
k = input() s = input() k = int(k) if len(s) <= k: print(s) else: print(s[0:k],"...",sep="")
[["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]]
5
43
def say_trim_log_words(): k = input() s = input() min_length = int(k) print(s if len(s) < min_length else '{}...'.format(s[:min_length])) if __name__ == '__main__': say_trim_log_words()
def say_trim_log_words(): k = input() s = input() min_length = int(k) print(s if len(s) <= min_length else '{}...'.format(s[:min_length])) if __name__ == '__main__': say_trim_log_words()
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 18], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 19]]
5
55
#include <stdio.h> #include <string.h> int main() { int n, i; scanf("%d", &n); char a[100]; getchar(); gets(a); int b = strlen(a); if (n >= b) puts(a); else { for (i = 0; i < n; i++) { printf("%c", a[i]); } } }
#include <stdio.h> #include <string.h> int main() { int n, i; scanf("%d", &n); char a[100]; getchar(); gets(a); int b = strlen(a); if (n >= b) puts(a); else { for (i = 0; i < n; i++) { printf("%c", a[i]); } printf("..."); } }
[["+", 75, 76, 0, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 62], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 25], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
0
89
#include "bits/stdc++.h" using namespace std; #define int long long #define rep(i, n) for (int i = 0, size_##i = (n); i < size_##i; i++) #define FOR(i, a, b) for (int i = (a), int size##i = (b); i < size##i; i++) #define FORR(i, a, b) for (int i = (a); i >= (b); i--) #define pb push_back #define fst first #define s...
#include "bits/stdc++.h" using namespace std; #define int long long #define rep(i, n) for (int i = 0, size_##i = (n); i < size_##i; i++) #define FOR(i, a, b) for (int i = (a), int size##i = (b); i < size##i; i++) #define FORR(i, a, b) for (int i = (a); i >= (b); i--) #define pb push_back #define fst first #define s...
[["+", 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
274
K = int(input()) S = input() if len(S) <+ K: print(S) elif len(S) > K: SK = S[: K]+ "..." print(SK)
K = int(input()) S = input() if len(S) <= K: print(S) elif len(S) > K: SK = S[: K]+ "..." print(SK)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["-", 0, 656, 0, 57, 15, 666, 0, 664, 17, 72], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
49
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) { cout << S << endl; } if (S.size() > K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "…" << 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; } if (S.size() > K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
89
k = int(input()) s = input() if (k > len(s)): print(s) elif(k < len(s)): ans = k-len(s) print(s[:ans]+'...')
k = int(input()) s = input() if (k >= len(s)): print(s) elif(k < len(s)): ans = k-len(s) print(s[:ans]+'...')
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
57