buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <iostream> using namespace std; int main() { string S; int K; cin >> K >> S; if (S.size() < K) cout << S << endl; else { for (int i = 0; i < K; i++) { cout << S[i]; } cout << "..." << endl; } }
#include <iostream> using namespace std; int main() { string S; int K; cin >> K >> S; if (S.size() <= 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
74
a=input() b=input() if len(b) < int(a): print(b) else: print(b[0:int(a)]+'...')
a=input() b=input() if len(b) <= int(a): print(b) else: print(b[0:int(a)]+'...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
43
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int x = s.size(); if (x < 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; cin >> k; string s; cin >> s; int x = s.size(); if (x <= k) cout << s; else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
77
K = int(input()) S = str(input()) sen = '' if len(S)<=K: print(S) else: # print(S[0:K-1]) sen = S[0:K-1] + '...' print(sen)
K = int(input()) S = str(input()) sen = '' if len(S)<=K: print(S) else: # print(S[0:K-1]) sen = S[0:K] + '...' print(sen)
[["-", 12, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 12, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
53
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int sl = s.size(); if (sl <= k) cout << s << endl; else cout << s.substr(0, k) << "…" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int sl = s.size(); if (sl <= k) cout << s << endl; else cout << s.substr(0, k) << "..." << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
68
n=int(input()) s=(input()) l=len(s) if n<=l: print(s) else: print(s[0:n]+"...")
n=int(input()) s=(input()) l=len(s) if n>=l: print(s) else: print(s[0:n]+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
45
#include "bits/stdc++.h" #include <cstring> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { string s; int k; cin >> k >> s; if (s.size() < k) { cout << s << endl; } else { string front_s = s.substr(0, k); cout << front_s << "..." << endl; ...
#include "bits/stdc++.h" #include <cstring> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { string s; int k; cin >> k >> s; if (s.size() <= k) { cout << s << endl; } else { string front_s = s.substr(0, k); cout << front_s << "..." << endl; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
87
K = int(input()) S = input() ls = list(S) if len(S) >= K: ansl = ls[0:K] print(''.join(ansl) + '...') else: print(S)
K = int(input()) S = input() ls = list(S) if len(S) > K: ansl = ls[0:K] print(''.join(ansl) + '...') else: print(S)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
55
#define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!! #include <bits/stdc++.h> #include <cmath> using ll = long long; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1...
#define _GLIBCXX_DEBUG // TLEの原因になるので注意!!!!!!!!!!! #include <bits/stdc++.h> #include <cmath> using ll = long long; using namespace std; vector<int> arr; stack<int> st; queue<int> qu; queue<pair<int, int>> qu2; priority_queue<int> pq; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, n) for (int i = 1...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
322
k= int(input()) s= input() if len(s)<k: print(s) else: s=s[0:k] print(s+"...")
k= int(input()) s= input() if len(s)<=k: print(s) else: s=s[0:k] print(s+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
43
k = int(input()) s = input() if k <= len(s): print(s[:k] + '...') else: print(s)
k = int(input()) s = input() if len(s) > k: print(s[:k] + '...') else: print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
39
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; if (n == (int)s.size()) { cout << s; return 0; } else { string ans = s.substr(0, n); ans += "..."; cout << ans; return 0; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; string s; cin >> n >> s; if (n >= (int)s.size()) { cout << s; return 0; } else { string ans = s.substr(0, n); ans += "..."; cout << ans; return 0; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
74
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG int64_t MOD = 10000007; int main() { string S; int K; cin >> K >> S; if (S.size() <= K) cout << S; else { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "…"; } }
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG int64_t MOD = 10000007; int main() { string S; int K; cin >> K >> S; if (S.size() <= K) cout << S; else { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..."; } }
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
79
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() < k) cout << s << endl; else { string t = s.substr(0, k); t += "..."; cout << t << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) cout << s << endl; else { string t = s.substr(0, k); t += "..."; cout << t << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
69
#include <bits/stdc++.h> using namespace std; using ll = long long; #define pb push_back #define ff first #define ss second #define all(a) a.begin(), a.end() #define sz(a) (int)(a.size()) #define clr(a, b) memset(a, b, sizeof(a)) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REPD(i, a, b) for...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define pb push_back #define ff first #define ss second #define all(a) a.begin(), a.end() #define sz(a) (int)(a.size()) #define clr(a, b) memset(a, b, sizeof(a)) #define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i) #define REPD(i, a, b) for...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
225
import math #def main(S, b): if __name__ == '__main__': #a, b, c, k = map(int, input().split()) k = int(input()) n = input() #print(n[-1]) if (len(n) < k): print(n) else: print(n[:k] + "...") # if (s == t[:(len(s))] and len(t) == len(s) + 1): # print("Yes") # el...
import math #def main(S, b): if __name__ == '__main__': #a, b, c, k = map(int, input().split()) k = int(input()) n = input() #print(n[-1]) if (len(n) <= k): print(n) else: print(n[:k] + "...") # if (s == t[:(len(s))] and len(t) == len(s) + 1): # print("Yes") # e...
[["-", 64, 196, 0, 57, 15, 23, 0, 666, 667, 18], ["+", 64, 196, 0, 57, 15, 23, 0, 666, 667, 19]]
5
58
import os def main(): k = int(input()) s = input() ans = "" if (len(s) <= k): print(s) else: ans = s[:7] + "..." print(ans) if __name__ == "__main__": main()
import os def main(): k = int(input()) s = input() ans = "" if (len(s) <= k): print(s) else: ans = s[:k] + "..." print(ans) if __name__ == "__main__": main()
[["-", 0, 662, 12, 657, 31, 206, 206, 663, 0, 612], ["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22]]
5
65
K = gets.to_i S = gets.chomp if(K>S.length) puts S else print S[0...K] print "...\n" end
K = gets.to_i S = gets.chomp if(K>=S.length) puts S else print S[0...K] print "...\n" end
[["-", 0, 493, 0, 121, 15, 739, 0, 738, 17, 47], ["+", 0, 493, 0, 121, 15, 739, 0, 738, 17, 20]]
4
34
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(); if (k <= s.length()) { s = s.substring(0, k) + "..."; System.out.println(s); } else { System.out.prin...
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(); if (k < s.length()) { s = s.substring(0, k) + "..."; System.out.println(s); } else { System.out.print...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18]]
3
107
#include <algorithm> #include <cmath> #include <iostream> #include <iterator> #include <vector> using namespace std; int main() { int K, i, len; char S[250]; cin >> K >> S; len = 0; for (i = 0; S[i] != '\0'; i += 1) { len += 1; } if (len <= K) { cout << S << endl; } else { for (i = 0; i < l...
#include <algorithm> #include <cmath> #include <iostream> #include <iterator> #include <vector> using namespace std; int main() { int K, i, len; char S[250]; cin >> K >> S; len = 0; for (i = 0; S[i] != '\0'; i += 1) { len += 1; } if (len <= K) { cout << S << endl; } else { for (i = 0; i < K...
[["-", 0, 7, 15, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 17, 33], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
120
#include <bits/stdc++.h> #include <string> using namespace std; void solve() { int k; cin >> k; string s; cin >> s; string ss = "..."; if (s.length() <= k) { cout << s << endl; } else { cout << s.substr(0, 7) + ss << endl; } } int main() { solve(); }
#include <bits/stdc++.h> #include <string> using namespace std; void solve() { int k; cin >> k; string s; cin >> s; string ss = "..."; if (s.length() <= k) { cout << s << endl; } else { cout << s.substr(0, k) + ss << endl; } } int main() { solve(); }
[["-", 31, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22]]
1
81
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, 7) + "..."); } } }
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) + "..."); } } }
[["-", 3, 4, 0, 16, 31, 492, 3, 4, 0, 499], ["+", 3, 4, 0, 16, 31, 492, 3, 4, 0, 22]]
3
97
#include <bits/stdc++.h> using namespace std; #define rep0(i, n) for (i = 0; i < n; i++) #define test(a) cout << "*" << a << endl; int main() { int i; int k; string s; cin >> k; cin >> s; if (s.size() < k) { cout << s; } else { rep0(i, k) { cout << s[i]; } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep0(i, n) for (i = 0; i < n; i++) #define test(a) cout << "*" << a << endl; int main() { int i; int k; string s; cin >> k; cin >> s; if (s.size() <= k) { cout << s; } else { rep0(i, k) { 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
85
N = int(input()) M = str(input()) if len(M)>N: print(M[0:7]+'...') else: print(M)
N = int(input()) M = str(input()) if len(M)>N: print(M[0:N]+'...') else: print(M)
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
43
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; typedef unsigned long long ull; typedef long double ld; int main() { int N; string K; cin >> N >> K; if ((int)(K.length()) < N) ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) typedef long long ll; typedef unsigned long long ull; typedef long double ld; int main() { int N; string K; cin >> N >> K; if ((int)(K.length()) <= N)...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
103
k = int(input()) s = str(input()) if len(s) > k: print(s[:7]+ '...') else: print(s)
k = int(input()) s = str(input()) if len(s) > k: print(s[:k]+ '...') else: print(s)
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int a, b; string s, c; cin >> a >> s; b = s.size(); if (b > a) { c = s.substr(0, 7); cout << c; cout << "..."; } else { cout << s; } }
#include <bits/stdc++.h> using namespace std; int main() { int a, b; string s, c; cin >> a >> s; b = s.size(); if (b > a) { c = s.substr(0, a); cout << c; cout << "..."; } else { cout << s; } }
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
72
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { long long K; cin >> K; string s; cin >> s; if (s.length() < K) { cout << s << endl; } else { for (int i = 0; i < K; i++) { cout << s[i]; } cout << "..."; } }
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { long long K; cin >> K; string s; cin >> s; if (s.length() <= K) { cout << s << endl; } else { for (int i = 0; i < K; i++) { cout << s[i]; } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
81
k = int(input()) s = input() w = len(s) if w <= k: print(s) else: ans = s[0:k-1] print('%s...' % ans)
k = int(input()) s = input() w = len(s) if w <= k: print(s) else: ans = s[0:k] print('%s...' % ans)
[["-", 0, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612]]
5
48
import java.io.*; import java.util.*; class Main { public static void main(String args[]) throws IOException { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int K = Integer.parseInt(br.readLine()); String input = br.readLine(); if (K >= input.len...
import java.io.*; import java.util.*; class Main { public static void main(String args[]) throws IOException { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int K = Integer.parseInt(br.readLine()); String input = br.readLine(); if (K >= input.len...
[["-", 0, 11, 12, 492, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 492, 3, 4, 0, 16, 12, 499]]
3
128
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string str; int k; cin >> k; cin >> str; if (k > str.length()) cout << str; else { for (int i = 0; i < k; i++) cout << str[i]; cout << "..."; } return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int int main() { string str; int k; cin >> k; cin >> str; if (k >= str.length()) cout << str; else { for (int i = 0; i < k; i++) cout << str[i]; cout << "..."; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
76
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) { cout << s << endl; } else { string str; int temp = s.size() - k; for (int i = 0; i < temp - 1; i++) { str += s[i]; } cout << str << "..." <<...
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int k; cin >> k; string s; cin >> s; if (s.size() <= k) { cout << s << endl; } else { string str; int temp = s.size() - k; for (int i = 0; i < k; i++) { str += s[i]; } cout << str << "..." << endl; ...
[["-", 0, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
99
n= int(input()) L = list(input()) if len(L)<n: print(''.join(L)) else: print(''.join(L[:n])+'...')
n= int(input()) L = list(input()) if n>=len(L): print(''.join(L)) else: print(''.join(L[:n])+'...')
[["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
54
#include <algorithm> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, string> P; int main() { int k; cin >> k; string s; c...
#include <algorithm> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <math.h> #include <stdio.h> #include <utility> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, string> P; int main() { int k; cin >> k; string s; c...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
116
K = int(input()) S = input() if len(S) < K: print(S) else: print(S[:K], end="") print("...")
K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[:K], end="") print("...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
46
#include <bits/stdc++.h> using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); string s; int k; cin >> k; cin >> s; if (k <= s.size()) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } else { for (int i = 0; i < s.size(); i+...
#include <bits/stdc++.h> using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); string s; int k; cin >> k; cin >> s; if (k < s.size()) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } else { for (int i = 0; i < s.size(); i++...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
118
k = int(input()); s = input(); n = int(len(s)); a = '…' if k >= n: print(s); else: print(s[:k] + a);
k = int(input()); s = input(); n = int(len(s)); a = '...' if k >= n: print(s); else: print(s[:k] + a);
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
53
#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() { int k; cin >> k; string s; cin >> s; int l = s.size(); if (l < k) { cout << s << endl; } else { cout << s.erase(k) + "..." << endl; } retu...
#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() { int k; cin >> k; string s; cin >> s; int l = s.size(); if (l <= k) { cout << s << endl; } else { cout << s.erase(k) + "..." << endl; } ret...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
94
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int K; string S; cin >> K >> S; int a = S.size(); if (a <= K) { cout << S << endl; } else { rep(i, K) { cout << S[i]; } cout << "…" << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int K; string S; cin >> K >> S; int a = S.size(); if (a <= K) { cout << S << endl; } else { rep(i, K) { cout << S[i]; } cout << "..." << endl; } }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
81
#include <stdio.h> #include <string.h> int main() { int k, len; scanf("%d", &k); char s[101]; scanf("%s", s); len = strlen(s); if (s > k) { for (int i = 0; i < k; i++) { printf("%c", s[i]); } printf("..."); return 0; } printf("%s", s); return 0; }
#include <stdio.h> #include <string.h> int main() { int k, len; scanf("%d", &k); char s[101]; scanf("%s", s); len = strlen(s); if (len > k) { for (int i = 0; i < k; i++) { printf("%c", s[i]); } printf("..."); return 0; } printf("%s", s); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 31, 22]]
0
105
#include <bits/stdc++.h> using namespace std; int main() { long long a = 0, b = 0, c = 0, d = 0, m = 0, n = 0, p = 0, q = 0; string s; cin >> a >> s; if (s.size() > a) { for (int i = 0; i < a; i++) { cout << s.at(i); } cout << "…"; } else { cout << s; } }
#include <bits/stdc++.h> using namespace std; int main() { int a = 0, b = 0, c = 0, d = 0, m = 0, n = 0, p = 0, q = 0; string s; cin >> a >> s; if (s.size() > a) { for (int i = 0; i < a; i++) { cout << s.at(i); } cout << "..."; } else { cout << s; } }
[["-", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
105
#include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, \ tree_order_statistics_node_update> using namespa...
#include "bits/stdc++.h" #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" #define ordered_set \ tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, \ tree_order_statistics_node_update> using namespa...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
272
package main import ( "fmt" "strings" ) func main() { var k int var s string fmt.Scan(&k, &s) ans := exec(k, s) fmt.Println(ans) } func exec(k int, s string) string { l := strings.Split(s, "") if len(l) < k { return s } var v string for i := 0; i < k; i++ { v += l[i] } return v + "..." }
package main import ( "fmt" "strings" ) func main() { var k int var s string fmt.Scan(&k, &s) ans := exec(k, s) fmt.Println(ans) } func exec(k int, s string) string { l := strings.Split(s, "") if len(l) <= k { return s } var v string for i := 0; i < k; i++ { v += l[i] } return v + "..." }
[["-", 0, 435, 8, 196, 0, 57, 15, 16, 17, 18], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 17, 19]]
7
127
#include <iostream> #include <string> using namespace std; int main() { int k; string word, temp = ""; cin >> k; cin >> ws; cin >> word; if (word.length() <= k) { cout << word; exit(0); } else { for (int i = 0; i < k; i++) temp += word[i]; } temp += " ..."; cout << temp; retur...
#include <iostream> #include <string> using namespace std; int main() { int k; string word, temp = ""; cin >> k; cin >> ws; cin >> word; if (word.length() <= k) { cout << word; exit(0); } else { for (int i = 0; i < k; i++) temp += word[i]; } temp += "..."; cout << temp; return...
[["-", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 11, 12, 5, 0, 6]]
1
95
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; string s; cin >> n >> s; if (s.size() < n) { cout << s << endl; } else { string new_s = ""; rep(i, n) { new_s += s.at(i); } cout << new_s << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int n; string s; cin >> n >> s; if (s.size() <= n) { cout << s << endl; } else { string new_s = ""; rep(i, n) { new_s += s.at(i); } cout << new_s << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
86
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String k = sc.nextLine(); int kInt = Integer.parseInt(k); String s = sc.nextLine(); if (s.length() > kInt) { s = s.substring(0, kInt); } s += "..."; System...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String k = sc.nextLine(); int kInt = Integer.parseInt(k); String s = sc.nextLine(); if (s.length() > kInt) { s = s.substring(0, kInt); s += "..."; } Syst...
[["-", 0, 195, 8, 196, 0, 57, 64, 196, 0, 46], ["+", 0, 195, 8, 196, 0, 57, 64, 196, 0, 46]]
3
101
#include <iostream> #include <string.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() <= k) cout << s; else cout << s.substr(0, k - 1) + "..."; return 0; }
#include <iostream> #include <string.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() <= k) cout << s; else cout << s.substr(0, k) + "..."; return 0; }
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
63
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() <= K) { cout << K << endl; } else { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } }
#include <algorithm> #include <iostream> #include <vector> 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; } }
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
82
K=int(input()) S=input() if K>=len(S): print(S) else: mae=S[0:len(S)-1] ans=mae + "..." print(ans)
K=int(input()) S=input() if K>=len(S): print(S) else: mae=S[0:K] ans=mae+"..." print(ans)
[["-", 12, 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, 662, 12, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 662, 12, 206, 206, 663, 0, 657, 12, 612], ["+", 0, 1, 0, 662, 12, 20...
5
51
K = int(input()) S = input() K = min(len(S), K) for i in range(K): print(S[i], end='') print('...' if K > len(S) else '')
K = int(input()) S = input() K = min(len(S), K) for i in range(K): print(S[i], end='') print('...' if K < len(S) else '')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 47], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 18]]
5
60
import java.util.Scanner; public class Main { static int K; static String S; static int s; static String x; public static void main(String[] args) { Scanner sc = new Scanner(System.in); K = sc.nextInt(); S = sc.next(); s = S.length(); if (K > s) { System.out.println(S); } else {...
import java.util.Scanner; public class Main { static int K; static String S; static int s; static String x; public static void main(String[] args) { Scanner sc = new Scanner(System.in); K = sc.nextInt(); S = sc.next(); s = S.length(); if (K >= s) { System.out.println(S); } else ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
119
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int inf = 1001001001; int main() { string s, t; int k; cin >> k >> s; if (s.size() <= k) cout << s << endl; if (s.size() > k) { for (int i = 0; i < 7; i++) { t.push_back(s....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; typedef long long ll; const int inf = 1001001001; int main() { string s, t; int k; cin >> k >> s; if (s.size() <= k) cout << s << endl; if (s.size() > k) { for (int i = 0; i < k; i++) { t.push_back(s....
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]]
1
111
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace ::std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() > k) { cout << s.substr(0, k) << endl; } else { cout << s << endl; } return 0; }
#include <cmath> #include <iostream> #include <string> #include <vector> using namespace ::std; int main() { int k; string s; cin >> k; cin >> s; if (s.length() > k) { cout << s.substr(0, k) << "..." << endl; } else { cout << s << endl; } return 0; }
[["+", 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
70
n = int(input()) s = str(input()) if len(s) <= n: print(s) else: print(s[:n+1]+"...")
n = int(input()) s = str(input()) if len(s) <= n: print(s) else: print(s[:n]+"...")
[["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
44
if __name__ == "__main__": K = int(input()) S = input() if K > len(list(S)): print(S) else: print(S[:K], end='') print("...")
if __name__ == "__main__": K = int(input()) S = input() if K >= len(list(S)): print(S) else: print(S[:K], end='') print("...")
[["-", 0, 57, 64, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 57, 64, 196, 0, 57, 15, 666, 667, 20]]
5
56
k = gets.to_i s = gets if (s.size <= k) puts s else puts "#{s[0..(k-1)]}..." end
k = gets.to_i s = gets.chop if (s.size <= k) puts s else puts "#{s[0..(k-1)]}..." end
[["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
36
k = int(input()) S = input() s = list(S) if len(s) < k: print(S) else: print(S[0:k] + "...")
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]]
5
46
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int K = Integer.parseInt(scanner.nextLine()); String S = scanner.nextLine(); if (K > S.length()) { System.out.println(S); } else { String s = S.substring(0...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int K = Integer.parseInt(scanner.nextLine()); String S = scanner.nextLine(); if (K >= S.length()) { System.out.println(S); } else { String s = S.substring(...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
107
def main(): k = int(input()) s = str(input()) w = len(s) if w<k: print(s) else: print(s[:k] + '...') main()
def main(): k = int(input()) s = str(input()) w = len(s) if w<=k: print(s) else: print(s[:k] + '...') main()
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 19]]
5
53
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define ll long long #define re register #define pb push_back #define fi first #define se second const int N = 1e6 + 10; const int mod7 = 1e9 + 7; const int mod = 1e9 + 7; void read(int &a) { a = 0; int d = 1; char ch; while (ch = getchar(...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; #define ll long long #define re register #define pb push_back #define fi first #define se second const int N = 1e6 + 10; const int mod7 = 1e9 + 7; const int mod = 1e9 + 7; void read(int &a) { a = 0; int d = 1; char ch; while (ch = getchar(...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
323
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; #define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define REPR(i, n) for (ll(i) = (n); (i) >= 0; (i)--) #define FOR(i, m, n) for (ll(i) = (m); (i) < (n); (i)++) #define INF 1e9 #define ALL(v)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned int uint; typedef unsigned long long ull; #define REP(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define REPR(i, n) for (ll(i) = (n); (i) >= 0; (i)--) #define FOR(i, m, n) for (ll(i) = (m); (i) < (n); (i)++) #define INF 1e9 #define ALL(v)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
575
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int k; string s; cin >> k >> s; int ss = s.size(); for (int i = 0; i < min(k, ss); i++) cout << s.at(i); if (s.size() >= k) cout << "..."; cout << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int k; string s; cin >> k >> s; int ss = s.size(); for (int i = 0; i < min(k, ss); i++) cout << s.at(i); if (ss > k) cout << "..."; cout << "\n"; 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, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31,...
1
99
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def input(): return sys.stdin.readline() def resolve(): k = int(input()) s = input() if k >= len(s): print(s) else: print(s[:k] + "...") if __name__ == "__main__": resolve()
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys def input(): return sys.stdin.readline() def resolve(): k = int(input()) s = input().rstrip() if k >= len(s): print(s) else: print(s[:k] + "...") if __name__ == "__main__": resolve()
[["+", 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
71
k=int(input()) s=input() t=len(list(s)) print(t) n="" if(t<=k): print(s) else: for i in range(k): n=n+s[i] n=n+"..." print(n)
k=int(input()) s=input() t=len(list(s)) #print(t) n="" if(t<=k): print(s) else: for i in range(k): n=n+s[i] n=n+"..." print(n)
[["-", 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
70
k = int(input()) s = list(map(str, input())) if len(s) > k: for i in range(k): print(s[i], end="") print("...") else: for i in s: print(s[i], end='') print()
k = int(input()) s = list(map(str, input())) if len(s) > k: for i in range(k): print(s[i], end="") print("...") else: for i in s: print(i, end='') print()
[["-", 0, 1, 0, 652, 3, 4, 0, 206, 51, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 70], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73]]
5
77
#-*- utf-8 -*- k = int(input()) s = list(input()) rslt = "" for index in range(k): if len(s) > index: break rslt += s[index] if len(s) > k: rslt += "..." print(rslt, flush=True)
#-*- utf-8 -*- k = int(input()) s = list(input()) rslt = "" for index in range(k): if len(s) <= index: break rslt += s[index] if len(s) > k: rslt += "..." print(rslt, flush=True)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 47], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
65
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; int main() { int k; string s, t; cin >> k >> s; if (s.size() > k) { rep(i, k) t += s.at(i); t += "..."; ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (int i = 0; i < (int)(n); i++) using pii = pair<int, int>; using vi = vector<int>; using vvi = vector<vi>; int main() { int k; string s, t; cin >> k >> s; if (s.size() > k) { rep(i, k) t += s.at(i); t += "..."; ...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 75, 76, 0, 1, 0, 35]]
1
101
#------------------------------warmup---------------------------- import os import sys from io import BytesIO, IOBase import math BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in fi...
#------------------------------warmup---------------------------- import os import sys from io import BytesIO, IOBase import math BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in fi...
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
522
#include <bits/stdc++.h> using namespace std; int main() { string s, ans, a = "..."; int n, k; cin >> k; cin >> s; n = s.size(); if (n <= k) { ans = s; } else { ans = ans.substr(0, k) + a; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { string s, ans, a = "..."; int n, k; cin >> k; cin >> s; n = s.size(); if (n <= k) { ans = s; } else { ans = s.substr(0, k) + a; } cout << ans << endl; }
[["-", 0, 11, 12, 16, 31, 2, 63, 118, 28, 22], ["+", 0, 11, 12, 16, 31, 2, 63, 118, 28, 22]]
1
78
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; ++i) int main() { string s; ll k; cin >> k >> s; if (s.size() < k) cout << s << endl; else { rep(i, k) { cout << s[i]; } cout << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; ++i) int main() { string s; ll k; cin >> k >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) { cout << s[i]; } cout << "..." << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
83
#include "math.h" #include "stdio.h" #include "stdlib.h" #include "string.h" int main() { int i, j, k, n, len; char a[100000]; scanf("%d", &n); getchar(); scanf("%s", a); len = strlen(a); if (n <= len) { for (i = 0; i < n; i++) printf("%c", a[i]); printf("..."); } else printf("%s", a)...
#include "math.h" #include "stdio.h" #include "stdlib.h" #include "string.h" int main() { int i, j, k, n, len; char a[100000]; scanf("%d", &n); getchar(); scanf("%s", a); len = strlen(a); if (n < len) { for (i = 0; i < n; i++) printf("%c", a[i]); printf("..."); } else printf("%s", a);...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18]]
0
122
def actual(k, s): if len(s) >= k: return f'{s[:k]}...' return s k = int(input()) s = input() print(actual(k, s))
def actual(k, s): if len(s) > k: return f'{s[:k]}...' return s k = int(input()) s = input() print(actual(k, s))
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47]]
5
51
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dl; const int iNF = 1e9 + 100; const ll INF = 1e18 + 100; typedef pair<int, int> pii; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= k) { cout << s << endl; } else { auto y = s.substr(0, 7); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef double dl; const int iNF = 1e9 + 100; const ll INF = 1e18 + 100; typedef pair<int, int> pii; int main() { int k; string s; cin >> k; cin >> s; if (s.length() <= k) { cout << s << endl; } else { auto y = s.substr(0, k); ...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]]
1
108
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) { cout << S << endl; } else { int j = 0; while (j <= K) { cout << S.at(j); j++; } cout << "..." << endl; ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int K; string S; cin >> K; cin >> S; if (S.size() <= K) { cout << S << endl; } else { int j = 0; while (j < K) { cout << S.at(j); j++; } cout << "..." << endl; ...
[["-", 0, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["+", 0, 9, 0, 52, 15, 339, 51, 16, 17, 18]]
1
88
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int n = s.length(); if (k > n) { 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; cin >> k; string s; cin >> s; int n = s.length(); if (k >= n) { cout << s; } else { for (int i = 0; i < k; i++) cout << s[i]; cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
77
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char s[120]; int k, i; scanf("%d", &k); scanf("%s", s); if (strlen(s) < k) printf("%s", s); else { for (i = 0; i < k; i++) { printf("%c", s[i]); } printf("..."); } return 0; }
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char s[120]; int k, i; scanf("%d", &k); scanf("%s", s); if (strlen(s) <= k) printf("%s", s); else { for (i = 0; i < k; i++) { printf("%c", s[i]); } printf("..."); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]]
0
101
k=int(input()) s=input() if len(s)<=k:print(s) else:print(s[:k+1],end="...")
k=int(input()) s=input() if len(s)<=k:print(s) else:print(s[:k],end="...")
[["-", 3, 4, 0, 206, 206, 663, 0, 657, 17, 72], ["-", 3, 4, 0, 206, 206, 663, 0, 657, 12, 612]]
5
43
#include <iostream> #include <string> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int k; string s; cin >> k >> s; for (int i = 0; i < s.size(); i++) { if (i < k) cout << s[i]; else { cout << '...'; break; } } return 0; }
#include <iostream> #include <string> #define endl '\n' using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int k; string s; cin >> k >> s; for (int i = 0; i < s.size(); i++) { if (i < k) cout << s[i]; else { cout << "..."; break; } } return 0; }
[["-", 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
92
/* */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep2(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) rep2(i, 0, n) template <class T, class U> void chmin(T &t, U f) { if (t > f) t = f; } template <class T, class U> void chmax(T &t, U f) { if (t < f) t = f; } i...
/* */ #include <bits/stdc++.h> using namespace std; using ll = long long; #define rep2(i, a, n) for (int i = (a); i < (n); i++) #define rep(i, n) rep2(i, 0, n) template <class T, class U> void chmin(T &t, U f) { if (t > f) t = f; } template <class T, class U> void chmax(T &t, U f) { if (t < f) t = f; } i...
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
163
import sys def II(): return int(input()) def MI(): return map(int,input().split()) def LI(): return list(map(int,input().split())) def TI(): return tuple(map(int,input().split())) def RN(N): return [input().strip() for i in range(N)] def main(): K = II() S = input() Sl = len(S) print(Sl) if Sl <=...
import sys def II(): return int(input()) def MI(): return map(int,input().split()) def LI(): return list(map(int,input().split())) def TI(): return tuple(map(int,input().split())) def RN(N): return [input().strip() for i in range(N)] def main(): K = II() S = input() Sl = len(S) if Sl <= K: pr...
[["-", 0, 14, 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
158
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int k; string s, ans; cin >> k >> s; if (int(s.size()) < k) { ans = s; } else { ans = s.substr(0, k) + "..."; } cout << ans <...
#include <algorithm> #include <bits/stdc++.h> #include <cmath> #include <iostream> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int k; string s, ans; cin >> k >> s; if (int(s.size()) <= k) { ans = s; } else { ans = s.substr(0, k) + "..."; } cout << ans ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
84
#include <bits/stdc++.h> using namespace std; int main() { string s; int k; cin >> k >> s; if (k > s.size()) { cout << s << endl; } 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 >> s; if (k >= s.size()) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return (0); }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
81
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() >= k) { cout << s.substr(0, k) << "..." << endl; } else { cout << s << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() > k) { cout << s.substr(0, k) << "..." << endl; } else { cout << s << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
67
k = int(input()) s = input() if k <= len(s): s = s[0:k] + "..." print(s)
k = int(input()) s = input() if k < len(s): s = s[0:k] + "..." print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]]
5
37
#include <math.h> #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define PI 3.14159265359 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) int main() { int K; cin >> K; string S; cin >> S; ...
#include <math.h> #include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define PI 3.14159265359 #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) int main() { int K; cin >> K; string S; cin >> S; ...
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
90
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define N 100005 #define ll long long #define ull unsigned long long #define loop1(i, j, k, step) for (int i = j; i < k; i += step) #define loop(i, j, k) for (int i = j; i < k; i++) #define rloop1(i, j, k, step) for (int i = j; i >= k; i -= step) #def...
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define N 100005 #define ll long long #define ull unsigned long long #define loop1(i, j, k, step) for (int i = j; i < k; i += step) #define loop(i, j, k) for (int i = j; i < k; i++) #define rloop1(i, j, k, step) for (int i = j; i >= k; i -= step) #def...
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
249
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; // グラフ型 typedef long long ll; #define _GLIBCXX_DEBUG // 深さ優先探索 vector<bool> seen; int dfs(const Graph &G, ll v) { seen[v] = true; // v を訪問済にする int score = 0; // v から行ける各頂点 next_v について for (auto next_v : G[v]) { if (seen[next_...
#include <bits/stdc++.h> using namespace std; using Graph = vector<vector<int>>; // グラフ型 typedef long long ll; #define _GLIBCXX_DEBUG // 深さ優先探索 vector<bool> seen; int dfs(const Graph &G, ll v) { seen[v] = true; // v を訪問済にする int score = 0; // v から行ける各頂点 next_v について for (auto next_v : G[v]) { if (seen[next_...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
171
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) #define rep2(i, n) for (int i = 0; i <= n; i++) #define repr(i, a, n) for (int i = a; i < n; i++) #define all(a) a.begin(), a.end() #define P pair<long long, ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
240
k = int(input()) s = input() ls = len(s) if ls <=k: print(s) else: print(s+'...')
k = int(input()) s = input() ls = len(s) if ls <=k: print(s) else: print(s[:k]+'...')
[["+", 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
38
#include <bits/stdc++.h> using namespace std; long long n; string s; int main() { cin >> n; cin >> s; if (n > s.length()) cout << s << endl; else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "..." << endl; } }
#include <bits/stdc++.h> using namespace std; long long n; string s; int main() { cin >> n; cin >> s; if (n >= s.length()) cout << s << endl; else { for (int i = 0; i < n; i++) { cout << s[i]; } cout << "..." << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
77
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(); if (s.length() >= k) { System.out.println(s); } else { String sub = s.substring(0, k); System.out.println(sub ...
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(); if (s.length() <= k) { System.out.println(s); } else { String sub = s.substring(0, k); System.out.println(sub ...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
102
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() >= K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } else { cout << S << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() > K) { for (int i = 0; i < K; i++) { cout << S.at(i); } cout << "..." << endl; } else { cout << S << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
81
K=input() S=input() S=str(S) C=len(S) print(C) if(int(C)<=int(K)): print(S) else: print((S[:int(K)])+"...")
K=input() S=input() S=str(S) C=len(S) if(int(C)<=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
62
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using ll = long long; using P = pair<int, int>; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a,...
#include <bits/stdc++.h> #define _GLIBCXX_DEBUG using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using ll = long long; using P = pair<int, int>; ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a / gcd(a,...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
168
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() typedef long long ll; #define _GLIBCXX_DEBUG typedef vector<int> vec; typedef vector<ll> lvec; typedef vector<char> cvec; typedef vector<double> dvec;...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() typedef long long ll; #define _GLIBCXX_DEBUG typedef vector<int> vec; typedef vector<ll> lvec; typedef vector<char> cvec; typedef vector<double> dvec;...
[["+", 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
164
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() <= k) { cout << s << endl; } else { for (int i = 0; i < 7; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if (s.size() <= k) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
87
K = int(input()) S = input() if K >= len(S): print(S) else: print(S[0:7],end="") print("...")
K = int(input()) S = input() if K >= len(S): print(S) else: print(S[0:K],end="") print("...")
[["-", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 22]]
5
47
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; int INF = 100100101; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; string s; cin >> n >> s; if (n > s.length()) cout << s << endl; else { cout << s....
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long int ll; int INF = 100100101; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; string s; cin >> n >> s; if (n >= s.length()) cout << s << endl; else { cout << s...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 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
100
// Harry // Singh************************************************************************************************************** #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; #define endl '\n' #define ll long long #define maxn 100010 const in...
// Harry // Singh************************************************************************************************************** #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; #define endl '\n' #define ll long long #define maxn 100010 const in...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
141
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; #define Int int64_t using ll = long long; int main() { int k; cin >> k; string s; cin >> s; int m; m =...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdlib> #include <iostream> #include <map> #include <queue> #include <stdio.h> #include <string> #include <vector> using namespace std; #define Int int64_t using ll = long long; int main() { int k; cin >> k; string s; cin >> s; int m; m =...
[["+", 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
110