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
import sys input_methods=['clipboard','file','key'] using_method=0 input_method=input_methods[using_method] tin=lambda : map(int, input().split()) lin=lambda : list(IN()) mod=1000000007 #+++++ def main(): k = int(input()) #b , c = tin() s = input() if k > len(s): print(s) return ret = s[:k]+'...' print...
import sys input_methods=['clipboard','file','key'] using_method=0 input_method=input_methods[using_method] tin=lambda : map(int, input().split()) lin=lambda : list(IN()) mod=1000000007 #+++++ def main(): k = int(input()) #b , c = tin() s = input() if k >= len(s): print(s) return ret = s[:k]+'...' prin...
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20]]
5
229
K = int(input()) S = input() split_str = S[:K] if len(S) > K: print(split_str) else: print(S)
K = int(input()) S = input() split_str = S[:K] if len(S) > K: print(split_str+"...") else: print(S)
[["+", 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 <stdio.h> int main(void) { int k, i = 0; char s[102]; scanf("%d", &k); scanf("%s", s); while (s[i] != '\0') { i++; } if (i + 1 <= k) { printf("%s\n", s); } else if (i + 1 > k) { for (int j = 0; j < k; j++) { printf("%c", s[j]); } printf("...\n"); } return 0; }
#include <stdio.h> int main(void) { int k, i = 0; char s[102]; scanf("%d", &k); scanf("%s", s); while (s[i] != '\0') { i++; } if (i <= k) { printf("%s\n", s); } else if (i > k) { for (int j = 0; j < k; j++) { printf("%c", s[j]); } printf("...\n"); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 72], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13]]
0
127
#include <stdio.h> #include <string.h> int main(void) { // Your code here! int K; char S[105], Ans[105]; scanf("%d", &K); scanf("%s", S); for (int i = K; i <= 105; i++) { Ans[i] = '\0'; } for (int i = 0; i <= K - 1; i++) { Ans[i] = S[i]; } int n = strlen(S); if (n >= K) { for (in...
#include <stdio.h> #include <string.h> int main(void) { // Your code here! int K; char S[105], Ans[105]; scanf("%d", &K); scanf("%s", S); for (int i = K; i <= 105; i++) { Ans[i] = '\0'; } for (int i = 0; i <= K - 1; i++) { Ans[i] = S[i]; } int n = strlen(S); if (n >= K + 1) { for...
[["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 12, 13]]
0
153
#include <stdio.h> #include <string.h> int main(void) { //宣言 int K, i; char S[100], s[101]; S[0] = '\n'; s[0] = '\n'; //読み込み scanf("%d", &K); scanf("%s", S); //結果 if (strlen(S) >= K) { for (i = 0; i < K; i++) { printf("%c", S[i]); } printf("..."); } else { printf("%s", S); ...
#include <stdio.h> #include <string.h> int main(void) { //宣言 int K, i; char S[100], s[101]; S[0] = '\n'; s[0] = '\n'; //読み込み scanf("%d", &K); scanf("%s", S); //結果 if (strlen(S) > K) { for (i = 0; i < K; i++) { printf("%c", S[i]); } printf("..."); } else { printf("%s", S); ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]]
0
127
#n = int(input()) #a,b = map(int,input().split()) #a_L = list(map(int,input().split())) k = int(input()) s = list(input()) #print(len(s)) if len(s)+1 <= k: print("".join(s)) else: t = "".join(s[:k]) + "..." print(t)
#n = int(input()) #a,b = map(int,input().split()) #a_L = list(map(int,input().split())) k = int(input()) s = list(input()) #print(len(s)) if len(s) <= k: print("".join(s)) else: t = "".join(s[:k]) + "..." print(t)
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
63
#include <bits/stdc++.h> using namespace std; int main() { int a, c; string b; cin >> a >> b; c = b.size(); //ここまで問題なし if (a > c) { cout << b << endl; //ここまで問題なし } else { for (int i = 0; i < a; i++) { cout << b.at(i); } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, c; string b; cin >> a >> b; c = b.size(); //ここまで問題なし if (a >= c) { cout << b << endl; //ここまで問題なし } else { for (int i = 0; i < a; i++) { cout << b.at(i); } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
86
#include <bits/stdc++.h> #include <cstring> using namespace std; typedef long long ll; const long long inf64 = 1e18; // int func(ll arr, int n, int m){ // } int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); int k; stri...
#include <bits/stdc++.h> #include <cstring> using namespace std; typedef long long ll; const long long inf64 = 1e18; // int func(ll arr, int n, int m){ // } int main() { // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); cin.tie(NULL); int k; stri...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 57, 64, 9, 0, 116, 0, 117], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
1
127
k=input() s=input() if len(str(s)) <= int(k): print(s) if len(str(s)) >= int(k): print(s[0:int(k)], end='...')
k=input() s=input() if len(str(s)) <= int(k): print(s) if len(str(s)) > int(k): print(s[0:int(k)], end='...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
60
k = int(input()) s = input() if len(s) <= k: print(s) else: print(str(s[:7]) + "...")
k = int(input()) s = input() if len(s) <= k: print(s) else: print(str(s[:k]) + "...")
[["-", 31, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 31, 652, 3, 4, 0, 206, 206, 663, 0, 22]]
5
42
#include <algorithm> #include <bits/stdc++.h> //piの利用で必要(M_PI) #include <cmath> #include <fstream> #include <iostream> #include <random> #include <stdio.h> #include <string.h> //文字列の代入に使う #include <sys/stat.h> #include <unistd.h> #include <vector> int main() { int K; std::cin >> K; std::string SS; // std:...
#include <algorithm> #include <bits/stdc++.h> //piの利用で必要(M_PI) #include <cmath> #include <fstream> #include <iostream> #include <random> #include <stdio.h> #include <string.h> //文字列の代入に使う #include <sys/stat.h> #include <unistd.h> #include <vector> int main() { int K; std::cin >> K; std::string SS; // std:...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]]
1
124
from sys import stdin a=int(stdin.readline()) b=stdin.readline() if len(b)<=a: print(b) else: b=b[:a] b=b+'...' print(b)
from sys import stdin a=int(stdin.readline()) b=stdin.readline() if len(b)-1<=a: print(b) else: b=b[:a] b=b+'...' print(b)
[["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 33], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
53
#include <bits/stdc++.h> using namespace std; int main() { string S; int K, i; cin >> K; cin >> S; if (S.size() <= K) cout << K; else { for (i = 0; i < K; i++) { cout << S.at(i); } cout << "..."; } }
#include <bits/stdc++.h> using namespace std; int main() { string S; int K, i, l; cin >> K; cin >> S; if (S.size() <= K) cout << S; else { for (i = 0; i < K; i++) { cout << S.at(i); } cout << "..."; } }
[["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22]]
1
75
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) { cout << S; } else { for (int i = 0; i < K; i++) { cout << S[i]; } } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) { cout << S; } else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..."; } }
[["+", 75, 76, 0, 9, 0, 1, 0, 16, 31, 22], ["+", 75, 76, 0, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35]]
1
68
k = int(input()) s = str(input()) if len(s)<=k: print(s) else: print(str(s[:7]+'...'))
k = int(input()) s = str(input()) if len(s)<=k: print(s) else: print(str(s[:k]+'...'))
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
45
#include <iostream> using namespace std; int main() { int K; string S; cin >> K >> S; for (int i = 0; i < K; i++) { cout << S[i]; if (S.length() == i) { cout << endl; return 0; } } cout << "..." << endl; return 0; }
#include <iostream> using namespace std; int main() { int K; string S; cin >> K >> S; for (int i = 0; i < K; i++) { cout << S[i]; if (int(S.size() == i + 1)) { cout << endl; return 0; } } cout << "..." << endl; return 0; }
[["+", 8, 9, 0, 57, 15, 339, 51, 2, 63, 40], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 24], ["-", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["+", 3, 4, 0, 16, 31, 2, 63, 118, 119, 120], ["+", 51, 2, 3, 4, 0, 16, 12, 16, 17, 72], ["+", 51, 2, 3, 4, 0, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 25]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { string S; int K; cin >> K >> S; int size = S.size(); if (size < K) { cout << S << endl; return 0; } else { for (int i = 0; i < K; i++) cout << S[i]; cout << "..." << endl; return 0; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string S; int K; cin >> K >> S; int size = S.size(); if (size <= K) { cout << S << endl; return 0; } else { for (int i = 0; i < K; i++) cout << S[i]; cout << "..." << endl; return 0; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
88
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() > k) { for (size_t i = 0; i < k + 1; i++) { cout << s.at(i); } cout << "..." << endl; } else { for (char c : s) { cout << c; } cout << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() > k) { for (size_t i = 0; i < k; i++) { cout << s.at(i); } cout << "..." << endl; } else { for (char c : s) { cout << c; } cout << endl; } }
[["-", 64, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["-", 64, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
93
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { int K; string S; cin >> K; cin >> S; string R; if (S.size() < K) { R = S; } else { R = S.substr(0, K) + "..."; } cout << R << endl; }
#include <iostream> #include <stdio.h> #include <string> using namespace std; int main() { int K; string S; cin >> K; cin >> S; string R; if (S.size() <= K) { R = S; } else { R = S.substr(0, K) + "..."; } cout << R << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
73
K = int(input()) S = input() x = len(S) if x <= K: print(S) else: print(S[K - 1:] + '...')
K = int(input()) S = input() x = len(S) if x <= K: print(S) else: print(S[:K] + '...')
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 31, 22], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
44
N = int(input()) S = input() if len(S) < N: print(S) else: for i in range(N): print(S[i], end='') else: print("...")
N = int(input()) S = input() if len(S) <= N: print(S) else: for i in range(N): print(S[i], end='') else: print("...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
55
#include <bits/stdc++.h> using namespace std; int main() { unsigned int k; string s; cin >> k >> s; if (k <= s.size()) { cout << s << endl; } else { cout << s.substr(0, k) << "...\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { unsigned int k; string s; cin >> k >> s; if (k >= s.size()) { cout << s << endl; } else { cout << s.substr(0, k) << "...\n"; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
62
k=input() n=int(k) s=input() a=len(s) if a>=n: print(s[0:n] +"...") else: print(s)
k=input() n=int(k) s=input() a=len(s) if a>n: print(s[0: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
46
k = int(input()) s = str(input()) d = len(s) b = s[0:k] + '...' if k <= d: print(b) else: print(s)
k = int(input()) s = str(input()) d = len(s) b = s[0:k] + '...' if k < d: print(b) else: print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]]
5
49
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; vector<string> o; if (k > s.size()) cout << s << endl; else { 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; vector<string> o; if (k >= s.size()) cout << s << endl; else { for (int i = 0; i < k; ++i) cout << s.at(i); cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
82
k = int(input()) s = str(input()) if int(len(s)) < k: print(s) else: print(s[:k],"...",sep="")
k = int(input()) s = str(input()) if int(len(s)) <= k: print(s) else: print(s[:k],"...",sep="")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
50
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int a = s.size(); if (s.size() < k) cout << s << endl; else cout << s.erase(k) << "..." << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k >> s; int a = s.size(); if (a <= k) cout << s << endl; else cout << s.erase(k) << "..." << endl; return 0; }
[["-", 15, 339, 51, 16, 31, 2, 63, 118, 28, 22], ["-", 15, 339, 51, 16, 31, 2, 63, 118, 17, 131], ["-", 15, 339, 51, 16, 31, 2, 63, 118, 119, 120], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["-", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31,...
1
68
K = int(input()) S = input() if len(S) > K: print(S[:-K-1] + '...') else: print(S)
K = int(input()) S = input() if len(S) > K: print(S[:K]+'...') else: print(S)
[["-", 31, 206, 206, 663, 0, 657, 31, 664, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
42
<?php $K = (int)trim(fgets(STDIN)); $S = trim(fgets(STDIN)); //list($N,$M,$K) = array_map('intval',explode(" ",trim(fgets(STDIN)))); //$s = trim(fgets(STDIN)); //$A = array_map('intval',explode(" ",trim(fgets(STDIN)))); if (strlen($S)<=$K) { printf("%\n",$S); } else { printf("%s...\n",substr($S,0,$K)); }
<?php $K = (int)trim(fgets(STDIN)); $S = trim(fgets(STDIN)); //list($N,$M,$K) = array_map('intval',explode(" ",trim(fgets(STDIN)))); //$s = trim(fgets(STDIN)); //$A = array_map('intval',explode(" ",trim(fgets(STDIN)))); if (strlen($S)<=$K) { printf("%s\n",$S); } else { printf("%s...\n",substr($S,0,$K)); }
[["-", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610], ["+", 0, 613, 3, 3, 0, 28, 0, 609, 0, 610]]
6
75
K = int(input()) S = input() print(S[:len(S)-K]+'...' if len(S)>int(K) else S)
K = int(input()) S = input() print(S[:K]+'...' if len(S)>int(K) else S)
[["-", 31, 206, 206, 663, 0, 657, 31, 652, 63, 22], ["-", 206, 663, 0, 657, 31, 652, 3, 4, 0, 24], ["-", 206, 663, 0, 657, 31, 652, 3, 4, 0, 22], ["-", 206, 663, 0, 657, 31, 652, 3, 4, 0, 25], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33]]
5
42
/* * Created on: 17 / 5 / 2020 * Author: Eslam Waheed */ #include <bits/stdc++.h> //#include <bits/BIGINT.h> //#include <bits/Int128.h> using namespace std; //#define _CRT_SECURE_NO_WARNINGS //#define __USE_MINGW_ANSI_STDIO #define Eslam__Waheed \ ios...
/* * Created on: 17 / 5 / 2020 * Author: Eslam Waheed */ #include <bits/stdc++.h> //#include <bits/BIGINT.h> //#include <bits/Int128.h> using namespace std; //#define _CRT_SECURE_NO_WARNINGS //#define __USE_MINGW_ANSI_STDIO #define Eslam__Waheed \ ios...
[["-", 0, 7, 15, 16, 12, 16, 31, 2, 63, 22], ["-", 15, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["-", 15, 16, 12, 16, 31, 2, 3, 4, 0, 22], ["-", 15, 16, 12, 16, 31, 2, 3, 4, 0, 25], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33]]
1
215
// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools #include <bits/stdc++.h> using namespace std; using i64 = long long; const i64 MOD = 1e9 + 7; const i64 INF = i64(1e18) + 7; template <typename T> bool chmin(T &x, T y) { if (x > y) { x = y; return true; } return false; } templat...
// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools #include <bits/stdc++.h> using namespace std; using i64 = long long; const i64 MOD = 1e9 + 7; const i64 INF = i64(1e18) + 7; template <typename T> bool chmin(T &x, T y) { if (x > y) { x = y; return true; } return false; } templat...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
188
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; string s; cin >> n >> s; if (n == s.size()) { cout << s; } else { rep(i, n) { cout << s[i...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; string s; cin >> n >> s; if (n >= s.size()) { cout << s; } else { rep(i, n) { cout << s[i...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
102
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); if (s.length() <= k) { System.out.println(s); } else { System.out.println(s.substring(0, k - 1) + "..."); } sc.clos...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); if (s.length() <= k) { System.out.println(s); } else { System.out.println(s.substring(0, k) + "..."); } sc.close();...
[["-", 0, 16, 31, 492, 3, 4, 0, 16, 17, 33], ["-", 0, 16, 31, 492, 3, 4, 0, 16, 12, 499]]
3
105
K = int(input("K:")) S = str(input("S:")) s = len(S) if s <= K: print(S) else: print(S[:K] + "...")
K = int(input()) S = str(input()) s = len(S) if s <= K: print(S) else: print(S[:K] + "...")
[["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 3, 4, 0, 652, 3, 4, 0, 557, 0, 655]]
5
51
#include <iostream> #include <string> using namespace std; int main() { int len; int len_char; string chars; cin >> len; cin >> chars; len_char = chars.length(); if (len > len_char) { cout << chars; } else { cout << chars.substr(0, len) + "..."; } }
#include <iostream> #include <string> using namespace std; int main() { int len; int len_char; string chars; cin >> len; cin >> chars; len_char = chars.length(); if (len >= len_char) { cout << chars; } else { cout << chars.substr(0, len) + "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
69
K = int(input()) S = input() if len(S) <= K: print(S) else: S_ = S[0:K-1] print(S+'...')
K = int(input()) S = input() if len(S) <= K: print(S) else: S_ = S[0:K] print(S_+'...')
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22]]
5
45
#include <float.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #pragma region 定義 #define i_cin(X) scanf("%d", &X) #define i_cin2(X, Y) scanf("%d %d", &X, &Y) #define i_cin4(X, Y, Z, W) scanf("%d %d %d %d", &X, &Y, &Z, &W) #define i_cin3(X, Y, Z) scanf("%d %d %d", &X, &Y, &Z) #define l_...
#include <float.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #pragma region 定義 #define i_cin(X) scanf("%d", &X) #define i_cin2(X, Y) scanf("%d %d", &X, &Y) #define i_cin4(X, Y, Z, W) scanf("%d %d %d %d", &X, &Y, &Z, &W) #define i_cin3(X, Y, Z) scanf("%d %d %d", &X, &Y, &Z) #define l_...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
0
777
n = int(input()) str = input() print(str) if len(str) <= n else print(str[:n + 1] + '...')
n = int(input()) str = input() print(str) if len(str) <= n else print(str[:n] + '...')
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
39
#include <bits/stdc++.h> #define pb push_back #define fr first #define sc second #define MOD 1000000007 #define len(x) x.size() #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define all(v) v.begin(), v.end() #define f(i, a, n) for (int i = a; i < n; i++) using namespace std; typedef ve...
#include <bits/stdc++.h> #define pb push_back #define fr first #define sc second #define MOD 1000000007 #define len(x) x.size() #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define all(v) v.begin(), v.end() #define f(i, a, n) for (int i = a; i < n; i++) using namespace std; typedef ve...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
210
K,S = input().split() 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]+"...")
[["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 21], ["-", 0, 656, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]]
5
44
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; int cpi = S.size(); if (K < cpi) { string ans; for (int i = 0; i < K; i++) { ans += S.at(i); } cout << ans << endl; } else { cout << S << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K; cin >> S; int cpi = S.size(); if (K < cpi) { string ans; for (int i = 0; i < K; i++) { ans += S.at(i); } cout << ans + "..." << endl; } else { cout << S << endl; } }
[["+", 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
86
K = int(input()) S = input() tail_str = '' if K <= len(S): tail_str = '...' print('%s%s' % (S[:K], tail_str))
K = int(input()) S = input() tail_str = '' if K < len(S): tail_str = '...' print('%s%s' % (S[:K], tail_str))
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]]
5
46
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int main() { string s; int k; while (scanf("%d", &k) != EOF) { cin >> s; if (s.size() <= k) cout << s << endl; else cout << s.substr(0, 7) << "..." << endl; } return 0; }
#include <cstdio> #include <cstring> #include <iostream> using namespace std; int main() { string s; int k; while (scanf("%d", &k) != EOF) { cin >> s; if (s.size() <= 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, 22]]
1
79
#include <stdio.h> int main(void) { char str[100]; int num; int i; int cnt = 0; scanf("%d\n", &num); scanf("%s", str); for (cnt = 0; str[cnt] != '\0'; cnt++) ; if (num > cnt) { printf("%s", str); } else { str[num] = '.'; str[num + 1] = '.'; str[num + 2] = '.'; str[num + 3] = ...
#include <stdio.h> int main(void) { char str[100]; int num; int i; int cnt = 0; scanf("%d\n", &num); scanf("%s", str); for (cnt = 0; str[cnt] != '\0'; cnt++) ; if (num >= cnt) { printf("%s", str); } else { str[num] = '.'; str[num + 1] = '.'; str[num + 2] = '.'; str[num + 3] =...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
163
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; if (n >= s.size()) cout << s << endl; else { for (int i = 1; i <= s.size(); i++) { if (i > n) { cout << "..." << endl; return 0; } else cout << s[i]; } cout << endl; ...
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; if (n >= s.size()) cout << s << endl; else { for (int i = 1; i <= s.size(); i++) { if (i > n) { cout << "..." << endl; return 0; } else cout << s[i - 1]; } cout << en...
[["+", 0, 16, 12, 69, 341, 342, 0, 16, 17, 33], ["+", 0, 16, 12, 69, 341, 342, 0, 16, 12, 13]]
1
97
k = gets.chomp.to_i s = gets.chomp if s.size > k then puts s.slise(k) + "..." else puts s end
k = gets.chomp.to_i s = gets.chomp if s.size > k then puts s.slice(0..k-1) + "..." else puts s end
[["-", 0, 652, 3, 4, 0, 738, 31, 652, 735, 22], ["+", 0, 652, 3, 4, 0, 738, 31, 652, 735, 22], ["+", 0, 738, 31, 652, 3, 4, 0, 475, 756, 612], ["+", 0, 738, 31, 652, 3, 4, 0, 475, 17, 757], ["+", 31, 652, 3, 4, 0, 475, 444, 738, 17, 33], ["+", 31, 652, 3, 4, 0, 475, 444, 738, 12, 612]]
4
34
// package atcoder; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); char s[] = new char[S.length()]; for (int i = 0; i < S.length(); i++) { s = S.toCharArray(); // Syste...
// package atcoder; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); char s[] = new char[S.length()]; for (int i = 0; i < S.length(); i++) { s = S.toCharArray(); // Syste...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47]]
3
173
k = int(input()) s = list(input()) if k>=len(s): print(s) else: for i in range (k): print(s[i],end="") print("...")
k = int(input()) s =input() if k>=len(s): print(s) else: for i in range (k): print(s[i],end="") print("...")
[["-", 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]]
5
56
#include <cmath> #include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.size() <= k) cout << s << endl; else for (int i = 0; i < k; i++) { cout << s[i]; cout << "..." << endl; } return 0; }
#include <cmath> #include <iostream> #include <string> using namespace std; int main() { int k; string s; cin >> k >> s; if (s.size() <= k) cout << s << endl; else { for (int i = 0; i < k; i++) cout << s[i]; cout << "..." << endl; } return 0; }
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 0, 57, 75, 76, 0, 7, 8, 9, 0, 45]]
1
79
package main import ( "fmt" ) func main() { var k int fmt.Scanf("%d", &k) var s string fmt.Scanf("%s", &s) if len(s) < k { fmt.Printf("%s", s) return } fmt.Printf("%s...", s[:k]) }
package main import ( "fmt" ) func main() { var k int fmt.Scanf("%d", &k) var s string fmt.Scanf("%s", &s) if len(s) <= k { fmt.Printf("%s", s) return } fmt.Printf("%s...", s[:k]) }
[["-", 0, 435, 8, 196, 0, 57, 15, 16, 17, 18], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 17, 19]]
7
88
k = input() s = input() print(s) if(len(s) <= int(k)): print(s) else: print(s[:int(k)]+'...')
k = input() s = input() if(len(s) <= int(k)): print(s) else: print(s[:int(k)]+'...')
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
48
#include <iostream> #include <string> using namespace std; int K; string S; int main() { cin >> K; cin >> S; if ((int)S.length() < K) { cout << S << "\n"; } else { cout << S.substr(0, (size_t)K) << "...\n"; } }
#include <iostream> #include <string> using namespace std; int K; string S; int main() { cin >> K; cin >> S; if ((int)S.length() <= K) { cout << S << "\n"; } else { cout << S.substr(0, (size_t)K) << "...\n"; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]]
1
73
#include <bits/stdc++.h> using namespace std; int main() { int i, t, l; cin >> t; string a; cin >> a; l = a.size(); if (t > l) { cout << a << endl; return 0; } else { for (i = 0; i < t; i++) { cout << a[i]; } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int i, t, l; cin >> t; string a; cin >> a; l = a.size(); if (t >= l) { cout << a << endl; return 0; } else { for (i = 0; i < t; i++) { cout << a[i]; } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
88
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MAX(a, b, c) max(a, max(b, c)) #define MIN(a, b, c) min(a, min(b, c)) int main() { int n; cin >> n; string s; getline(cin, s); if (s.size() <= n) cout << s << endl; else { for (int i = 0; i < n; i++) cout << s[i]; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MAX(a, b, c) max(a, max(b, c)) #define MIN(a, b, c) min(a, min(b, c)) int main() { int n; cin >> n; string s; cin >> s; if (s.size() <= n) cout << s << endl; else { for (int i = 0; i < n; 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
105
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s, b; cin >> s; if (s.size() < k) cout << s; else { for (int i = 0; i < k; i++) b.push_back(s[i]); b.push_back('.'); b.push_back('.'); b.push_back('.'); } cout << b << '\n'; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s, b; cin >> s; if (s.size() <= k) cout << s; else { for (int i = 0; i < k; i++) b.push_back(s[i]); b.push_back('.'); b.push_back('.'); b.push_back('.'); } cout << b << '\n'; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
104
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int n = S.length(); if (K > n) cout << S << endl; else { string s = S.substr(0, K); cout << s << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int n = S.length(); if (K >= n) cout << S << endl; else { string s = S.substr(0, K); cout << s << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
70
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int K; string S; cin >> K >> S; if (S.length() > K) { cout << S.substr(0, K - 1) << "..." << endl; } else { cout << S << endl; } return 0; }
#include <bits/stdc++.h> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int K; string S; cin >> K >> S; if (S.length() > K) { cout << S.substr(0, K) << "..." << endl; } else { cout << S << endl; } return 0; }
[["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
84
#include <algorithm> #include <iostream> #include <map> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define all(x) (x).begin(), (x).end() typedef long long ll; template <class T> bo...
#include <algorithm> #include <iostream> #include <map> #include <stack> #include <string> #include <unordered_map> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = n - 1; i >= 0; i--) #define all(x) (x).begin(), (x).end() typedef long long ll; template <class T> bo...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
174
k=int(input()) s=str(input()) if len(s)<=k: print(s[:k]) else: print(s[:k]+"....")
k=int(input()) s=str(input()) if len(s)<=k: print(s[:k]) else: print(s[:k]+"...")
[["-", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6]]
5
46
#include <bits/stdc++.h> using namespace std; #define ll long long int #define endl '\n' int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // ll t; cin>>t; { ll k; cin >> k; string s; cin >> s; ll n = s.length(); if (n < k) cout << s; else {...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define endl '\n' int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); // ll t; cin>>t; { ll k; cin >> k; string s; cin >> s; ll n = s.length(); if (n <= k) cout << s; else ...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
108
k = int(input()) s = input() if len(s) <= 100: print(s) else: print(s[0:k], end='...')
k = int(input()) s = input() if len(s) <= k: print(s) else: print(s[0:k], end='...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
42
#include <iostream> #include <string> int main() { int A; std::cin >> A; std::string str; std::cin >> str; std::string substr = str.substr(0, A); if (A < str.size()) { std::cout << substr << "..." << std::endl; } if (A > str.size()) { std::cout << str << std::endl; } return 0; }
#include <iostream> #include <string> int main() { int A; std::cin >> A; std::string str; std::cin >> str; std::string substr = str.substr(0, A); if (A < str.size()) { std::cout << substr << "..." << std::endl; } if (A >= str.size()) { std::cout << str << std::endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
95
k=int(input()) s=str(input()) if len(s)>k: print(s[0:k]+"...")
k=int(input()) s=str(input()) if len(s)>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
k=int(input()) s=input() l=len(s) if l<=k: print(s) else: p=s[0:k-1] q='...' r=p+q print(r)
k=int(input()) s=input() l=len(s) if l<=k: print(s) else: p=s[0:k] q='...' r=p+q print(r)
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
54
#include <stdio.h> int main() { int k, t, i; char s[101]; scanf("%d %s", &k, s); for (i = 0; i <= k; i++) { if (s[i] == '\0') { t = i; break; } if (i < k) { printf("%c", s[i]); } } if (t - 1 <= k) { printf("\n"); } else { printf("...\n"); } }
#include <stdio.h> int main() { int k, t = 101, i; char s[101]; scanf("%d %s", &k, s); for (i = 0; i <= k; i++) { if (s[i] == '\0') { t = i; break; } if (i < k) { printf("%c", s[i]); } } if (t - 1 <= k) { printf("\n"); } else { printf("...\n"); } }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
0
115
k = gets.chomp.to_i s = gets.chomp if k > s.length puts s else puts s.slice(0..(k-1)) + "..." end
k = gets.chomp.to_i s = gets.chomp if k >= s.length puts s else puts s.slice(0..(k-1)) + "..." end
[["-", 36, 36, 0, 493, 0, 121, 15, 738, 17, 47], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 20]]
4
39
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long #define pb push_back #define mp make_pair #define pll pair<ll, ll> #define vll vector<int> #define mll map<ll, ll> #define pqg priority_queue<ll> #define pqs priority_queue<ll, vll, greater<ll>> #define setbits(x) __b...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define ll long long #define pb push_back #define mp make_pair #define pll pair<ll, ll> #define vll vector<int> #define mll map<ll, ll> #define pqg priority_queue<ll> #define pqs priority_queue<ll, vll, greater<ll>> #define setbits(x) __b...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
154
#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.at(i); } } cout << "..." << endl; return 0; }
#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.at(i); } cout << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
86
#include <iostream> #include <string> using namespace std; int main() { int n; string s; cin >> n; cin >> s; if (n == s.size()) cout << s << endl; else { for (int i = 0; i < s.size(); i++) { if (i < n) cout << s[i]; } cout << "..." << endl; } }
#include <iostream> #include <string> using namespace std; int main() { int n; string s; cin >> n; cin >> s; if (n >= s.size()) cout << s << endl; else { for (int i = 0; i < s.size(); i++) { if (i < n) cout << s[i]; } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
88
#include <iostream> #include <string> using namespace std; int main() { int K; string S; cin >> K; cin >> S; int ans = (int)(S.length()); if (ans <= K) { cout << S << endl; } else { cout << S.substr(0, 7) + "..." << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int K; string S; cin >> K; cin >> S; int ans = (int)(S.length()); if (ans <= K) { cout << S << endl; } else { cout << S.substr(0, K) + "..." << endl; } return 0; }
[["-", 31, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22]]
1
79
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() <= K) { cout << S << endl; } else { for (int i = 0; i < K; i++) { cout << S.at(i) << "..." << 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 { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } }
[["+", 0, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["+", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46], ["+", 0, 9, 0, 1, 0, 16, 31, 16, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46]]
1
76
#include <bits/stdc++.h> using namespace std; int main() { int n, x; string s; cin >> n; cin >> s; x = s.length(); if (x == n) cout << s << endl; else { for (int i = 0; i <= n - 1; i++) cout << s[i]; cout << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, x; string s; cin >> n; cin >> s; x = s.length(); if (x <= n) cout << s << endl; else { for (int i = 0; i <= n - 1; 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
85
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 50; ll a[maxn]; int main() { std::ios::sync_with_stdio(false); int n; cin >> n; string s; cin >> s; if (n <= s.size()) { for (int i = 0; i < n; i++) cout << s[i]; cout << "..." << endl; } else cout...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 50; ll a[maxn]; int main() { std::ios::sync_with_stdio(false); int n; cin >> n; string s; cin >> s; if (n < s.size()) { for (int i = 0; i < n; i++) cout << s[i]; cout << "..." << endl; } else cout ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
105
def main(): k = int(input()) s = input() l = len(s) if l <= k: print(s) else: print(s+"...") if __name__ == '__main__': main()
def main(): k = int(input()) s = input() l = len(s) if l <= k: print(s) else: print(s[:k]+"...") if __name__ == '__main__': main()
[["+", 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
53
K = gets.to_i S = gets.chomp if S.size < K+1 puts S else T = S.slice(0,K-1) U = T + '...' puts U end
K = gets.to_i S = gets.chomp if S.size < K+1 puts S else T = S.slice(0,K) U = T + '...' puts U end
[["-", 0, 662, 12, 652, 3, 4, 0, 738, 17, 33], ["-", 0, 662, 12, 652, 3, 4, 0, 738, 12, 612]]
4
43
k = gets.to_i s = gets.chomp.to_s l = s.length p l if l <= k puts s else puts s[0..(k-1)] + '...' end
k = gets.to_i s = gets.chomp.to_s l = s.length if l <= k puts s else puts s[0..(k-1)] + '...' end
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 36, 36, 0, 493, 0, 652, 3, 4, 0, 22]]
4
42
#include <bits/stdc++.h> using namespace std; int K; string S; void input() { cin >> K; cin >> S; } void solve() { if (S.length() <= K) { cout << S << endl; } else { string ans; for (int i = 0; i < 7; i++) { ans += S[i]; } ans += "..."; cout << ans << endl; } } int main() { ...
#include <bits/stdc++.h> using namespace std; int K; string S; void input() { cin >> K; cin >> S; } void solve() { if (S.length() <= K) { cout << S << endl; } else { string ans; for (int i = 0; i < K; i++) { ans += S[i]; } ans += "..."; cout << ans << endl; } } int main() { ...
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
108
#include <iostream> using namespace std; int main() { long long k; cin >> k; string s; cin >> s; if (s.length() <= k) { cout << s << endl; } else { cout << s.substr(0, k) << ".." << endl; } }
#include <iostream> using namespace std; int main() { long long k; cin >> k; string s; cin >> s; if (s.length() <= k) { cout << s << endl; } else { cout << s.substr(0, k) << "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
65
input_lines = readlines.map(&:chomp) K = input_lines.shift.to_i S = input_lines.shift result = if S.size < K S else "#{S[0, K]}..." end puts result
input_lines = readlines.map(&:chomp) K = input_lines.shift.to_i S = input_lines.shift result = if S.size <= K S else "#{S[0, K]}..." end puts result
[["-", 0, 493, 0, 662, 12, 121, 15, 738, 17, 18], ["+", 0, 493, 0, 662, 12, 121, 15, 738, 17, 19]]
4
45
#include <stdio.h> int main() { int a, len; char s[101]; char s2[101]; scanf("%d", &a); scanf("%s", s); len = strlen(s); if (len < a) { printf("%s\n", s); } else { strncpy(s2, s, a); s2[a] = '\0'; printf("%s...\n", s2); } return 0; }
#include <stdio.h> int main() { int a, len; char s[101]; char s2[101]; scanf("%d", &a); scanf("%s", s); len = strlen(s); if (len <= a) { printf("%s\n", s); } else { strncpy(s2, s, a); s2[a] = '\0'; printf("%s...\n", s2); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
103
#include <stdio.h> #include <string.h> int main(void) { int num, i; scanf("%d", &num); char str[100]; scanf("%s", str); if (strlen(str) <= num) { printf("%s", str); } else { for (i = 0; i < num; i++) { printf("%c", &str[i]); } printf("..."); } return 0; }
#include <stdio.h> #include <string.h> int main(void) { int num, i; scanf("%d", &num); char str[100]; scanf("%s", str); if (strlen(str) <= num) { printf("%s", str); } else { for (i = 0; i < num; i++) { printf("%c", str[i]); } printf("..."); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67]]
0
102
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); if (S.length() > K) { S = S.substring(K) + "..."; } System.out.println(S); } }
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int K = sc.nextInt(); String S = sc.next(); if (S.length() > K) { S = S.substring(0, K) + "..."; } System.out.println(S); } }
[["+", 0, 11, 12, 16, 31, 492, 3, 4, 0, 499], ["+", 0, 11, 12, 16, 31, 492, 3, 4, 0, 21]]
3
87
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; string S; cin >> N >> S; if (S.length() < N) cout << S << endl; else { cout << S.substr(0, N) << "..." << endl; } return 0; }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; string S; cin >> N >> S; if (S.length() <= N) cout << S << endl; else { cout << S.substr(0, N) << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
67
n = [input() for i in range(2)] k = int(n[0]) s = n[1] print(k,s) if len(s) <= k: print(s) else: s = s[0:k] + "..." print(s)
n = [input() for i in range(2)] k = int(n[0]) s = n[1] if len(s) <= k: print(s) else: s = s[0:k] + "..." print(s)
[["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 21], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
65
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; void printVector(const vector<string> &vec) { for (auto value : vec) { cout << value << ""; } cout << endl; } int main() { int k; string s; cin >> k >> s...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <utility> #include <vector> using namespace std; void printVector(const vector<string> &vec) { for (auto value : vec) { cout << value << ""; } cout << endl; } int main() { int k; string s; cin >> k >> s...
[["-", 64, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
1
138
# -*- coding: utf-8 -*- import sys import math #tmp = input().split() #n,m = list(map(lambda a: int(a), tmp)) k = int(input()) s = input() #tmp = input().split() #n,m,k = list(map(lambda a: int(a), tmp)) if(k>=len(s)): print(s) sys.exit() print(s[0:7]+"...")
# -*- coding: utf-8 -*- import sys import math #tmp = input().split() #n,m = list(map(lambda a: int(a), tmp)) k = int(input()) s = input() #tmp = input().split() #n,m,k = list(map(lambda a: int(a), tmp)) if(k>=len(s)): print(s) sys.exit() print(s[0:k]+"...")
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
54
n=int(input()) k=input() if len(k)<=n: print(k) else: a=k[0:n+1] print(a+"...")
n=int(input()) k=input() if len(k)<=n: print(k) else: a=k[:n] print(a+"...")
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
45
K = int(input()) S = input() if S.__len__() < K: print(S) else: print(S[0:K] + "...")
K = int(input()) S = input() if S.__len__() <= 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
41
#include <stdio.h> int main(void) { unsigned long int a, b, c; char s[100]; int i; scanf("%ld", &a); scanf("%s", &s); for (i = 0; i < 100; i++) { if (s[i] == '\0') { break; } } if (i + 1 <= a) { printf("%s", s); } else { for (i = 0; i < a; i++) { printf("%c", s[i]);...
#include <stdio.h> int main(void) { unsigned long int a, b, c; char s[100]; int i; scanf("%ld", &a); scanf("%s", &s); for (i = 0; i < 100; i++) { if (s[i] == '\0') { break; } } if (i <= a) { printf("%s", s); } else { for (i = 0; i < a; i++) { printf("%c", s[i]); ...
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 72], ["-", 0, 57, 15, 23, 0, 16, 31, 16, 12, 13]]
0
136
K=int(input()) S=input() if len(S) <= K: print(S) else: print(S[0:7]+"...")
K=int(input()) S=input() 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, 22]]
5
40
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() > k) { for (int i(0); i < 7; i++) cout << s[i]; cout << "..."; } else cout << s; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() > k) { for (int i(0); i < k; i++) cout << s[i]; cout << "..."; } else cout << s; }
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]]
1
71
#include <bits/stdc++.h> using namespace std; int main() { int N, p = 0; string S; cin >> N >> S; if (S.size() > N) p = 1; while (S.size() > N) S.pop_back(); cout << S; if (p) cout << '...'; cout << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N, p = 0; string S; cin >> N >> S; if (S.size() > N) p = 1; while (S.size() > N) S.pop_back(); cout << S; if (p) cout << "..."; cout << endl; }
[["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 104], ["-", 0, 57, 64, 1, 0, 16, 12, 103, 0, 125], ["-", 64, 1, 0, 16, 12, 103, 0, 42, 0, 131], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 57, 64, 1, 0, 16, 12, 5, 0, 6]]
1
78
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int a = S.size(); if (a > K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "" << endl; } else cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int a = S.size(); if (a > K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } else cout << S << endl; }
[["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
80
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int n; string s; cin >> n >> s; int len = s.length(); int ans = 0; if (len < n) { cout << s; ans = 1; } if (ans == 0) { for (int i = 0; i < n; i++) { cout << s.at(i); } cout << "..."; } }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int n; string s; cin >> n >> s; int len = s.length(); int ans = 0; if (len <= n) { cout << s; ans = 1; } if (ans == 0) { for (int i = 0; i < n; i++) { cout << s.at(i); } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
95
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 vector<int> vt; set<int> st; map<int, int> mp; unordered_map<string, int> umap; const long long MAX = 1e5; const long long INF = 1e9; const double pi = acos(-1); int main() { int a; cin >> a; string s; cin >> s; int l = s.length(); if (a...
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 vector<int> vt; set<int> st; map<int, int> mp; unordered_map<string, int> umap; const long long MAX = 1e5; const long long INF = 1e9; const double pi = acos(-1); int main() { int a; cin >> a; string s; cin >> s; int l = s.length(); if (l...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
141
#include <iostream> #include <string> using namespace std; void solve(long long K, std::string S) { if (K > S.size()) { cout << S << endl; } else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..." << endl; } } // Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tool...
#include <iostream> #include <string> using namespace std; void solve(long long K, std::string S) { if (K >= S.size()) { cout << S << endl; } else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..." << endl; } } // Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-too...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
118
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.next(); if (S.length() <= K) { System.out.println(S); } else { System.out.println(S.substring(K) + "..."); } ...
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.next(); if (S.length() <= K) { System.out.println(S); } else { System.out.println(S.substring(0, K) + "..."); ...
[["+", 3, 4, 0, 16, 31, 492, 3, 4, 0, 499], ["+", 3, 4, 0, 16, 31, 492, 3, 4, 0, 21]]
3
97
line = readlines.map(&:chomp) line[0] = line[0].to_i if line[1].length < line[0] puts line[1] else puts line[1][0, line[0]] + "..." end
line = readlines.map(&:chomp) line[0] = line[0].to_i if line[1].length <= line[0] puts line[1] else puts line[1][0, line[0]] + "..." end
[["-", 36, 36, 0, 493, 0, 121, 15, 738, 17, 18], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 19]]
4
56
#include <iostream> using namespace std; int main(void) { int K; string S; string S2; cin >> K; cin >> S; if ((int)S.length() < K) cout << S << endl; else { for (int i = 0; i < K; i++) { S2 += S[i]; } cout << S2 << "..." << endl; } return 0; }
#include <iostream> using namespace std; int main(void) { int K; string S; string S2; cin >> K; cin >> S; if ((int)S.length() <= K) cout << S << endl; else { for (int i = 0; i < K; i++) { S2 += S[i]; } cout << S2 << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
88