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
#ABC168B.rb k = gets.to_i s = gets.chomp.chars puts s.join if s.size <= k puts s.join else puts "#{s[0...k].join}..." end
#ABC168B.rb k = gets.to_i s = gets.chomp.chars if s.size <= k puts s.join else puts "#{s[0...k].join}..." end
[["-", 36, 36, 36, 36, 0, 493, 0, 652, 735, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 486, 22], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 0, 493, 0, 652, 3, 4, 0, 652, 735, 22]]
4
43
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int k; string S, t; cin >> k; cin >> S; if ((int)S.size() < k) { cout << S << endl; } else { t.resize(k); for (int i = 0; i < k; i++) { t[i] = S[i]; } t += "..."; cout << t << endl; }...
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int k; string S, t; cin >> k; cin >> S; if ((int)S.size() <= k) { cout << S << endl; } else { t.resize(k); for (int i = 0; i < k; i++) { t[i] = S[i]; } 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
104
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <string> #include <vector> #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using namespace std; int main() { int K; char szBuf[200] = {NULL}, Buf[200] = {NULL}; cin >> K; cin >> szBuf; if (szBuf[K - 1] != N...
#include <algorithm> #include <iomanip> #include <iostream> #include <math.h> #include <string> #include <vector> #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using namespace std; int main() { int K; char szBuf[200] = {NULL}, Buf[200] = {NULL}; cin >> K; cin >> szBuf; if (szBuf[K] != NULL)...
[["-", 51, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 51, 16, 31, 69, 341, 342, 0, 16, 12, 13]]
1
137
#!/usr/bin/env python # -*- coding: utf-8 -*- # # FileName: B # CreatedDate: 2020-05-17 21:05:31 +0900 # LastModified: 2020-05-17 21:07:49 +0900 # import os import sys #import numpy as np #import pandas as pd def main(): k = int(input()) s = input() if k<len(s): print("{}...".format(s[:7])) ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # FileName: B # CreatedDate: 2020-05-17 21:05:31 +0900 # LastModified: 2020-05-17 21:12:00 +0900 # import os import sys #import numpy as np #import pandas as pd def main(): k = int(input()) s = input() if k<len(s): print("{}...".format(s[:k])) ...
[["-", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 22]]
5
70
#include "bits/stdc++.h" using namespace std; #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define rep(i, x, n) for (int i = x; i < n; i++) #define all(x) x.begin(), x.end() #define pb ...
#include "bits/stdc++.h" using namespace std; #define fast_cin() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define rep(i, x, n) for (int i = x; i < n; i++) #define all(x) x.begin(), x.end() #define pb ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
171
#include <bits/stdc++.h> #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 namespace std; signed main() { cin.tie(0); ios_base::sync_with_stdio(false); int k; string s; cin >> k >> s; if (s.size() > k) { cout << s.substr(0, k); c...
#include <bits/stdc++.h> #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 namespace std; signed main() { cin.tie(0); ios_base::sync_with_stdio(false); int k; string s; cin >> k >> s; if (s.size() > k) { cout << s.substr(0, k); c...
[["-", 64, 9, 0, 1, 0, 16, 12, 103, 0, 104], ["-", 64, 9, 0, 1, 0, 16, 12, 103, 0, 125], ["-", 0, 1, 0, 16, 12, 103, 0, 42, 0, 131], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 62], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
101
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int l = S.size(); if (l <= K) { cout << S << endl; } else { cout << S.substr(0, K) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; int l = S.size(); if (l <= K) { cout << S << endl; } else { cout << S.substr(0, K) << "..." << endl; } }
[["+", 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
63
K = int(input()) S = input() ans= S if len(S) > K: ans = S[0:K+1] + "..." print(ans)
K = int(input()) S = input() ans= S if len(S) > K: ans = S[0:K] + "..." print(ans)
[["-", 12, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 12, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
42
/*input 40 ferelibenterhominesidquodvoluntcredunt */ #include <bits/stdc++.h> using namespace std; #define int long long int #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, a, b) for (int i = a; i < b; i++) #define all(c) c.begin(), c.end() #define init(arr, num) memset(arr, num, sizeof(arr)) #define f...
/*input 4 fere */ #include <bits/stdc++.h> using namespace std; #define int long long int #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, a, b) for (int i = a; i < b; i++) #define all(c) c.begin(), c.end() #define init(arr, num) memset(arr, num, sizeof(arr)) #define fast ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
331
from sys import stdin K = int(inpu()) S = input() if len(S) <= K: print(S) else: print(S[:K],'...',sep='')
from sys import stdin K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[:K],'...',sep='')
[["-", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22]]
5
48
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int t; t = s.size(); if (n < t) { for (int i = 0; i < t; i++) cout << s.at(i); cout << "..." << endl; } else { cout << s << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int t; t = s.size(); if (n < t) { for (int i = 0; i < n; i++) cout << s.at(i); cout << "..." << endl; } else { cout << s << endl; } }
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]]
1
85
k = int(input()) s = str(input()) if k > len(s): print(s) else: print('{st}...'.format(st=s[0:k]))
k = int(input()) s = str(input()) if k+1 > len(s): print(s) else: print('{st}...'.format(st=s[0:k]))
[["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 72], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
48
#include <algorithm> #include <array> #include <cctype> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; using VI = vector<int>; int main() { int k; cin >> k; string s; cin >> s; if (s.size(...
#include <algorithm> #include <array> #include <cctype> #include <iostream> #include <map> #include <queue> #include <string> #include <tuple> #include <utility> #include <vector> using namespace std; using ll = long long; using VI = vector<int>; int main() { int k; cin >> k; string s; cin >> s; if (s.size(...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
110
import numpy,math n = int(input()) s = str(input()) if(len(s) <= n): print(s) else: print(s[:n+1 + "..."])
import numpy,math n = int(input()) s = str(input()) if(len(s) <= n): print(s) else: print(s[:n] + "...")
[["-", 0, 206, 206, 663, 0, 657, 31, 657, 17, 72], ["-", 0, 206, 206, 663, 0, 657, 31, 657, 12, 612], ["+", 0, 652, 3, 4, 0, 657, 31, 206, 0, 73], ["-", 0, 1, 0, 652, 3, 4, 0, 206, 0, 73]]
5
50
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() > k) { s.resize(7); s += "..."; cout << s; } else cout << s; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.size() > k) { s.resize(k); s += "..."; cout << s; } else cout << s; return 0; }
[["-", 64, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 64, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
63
#include <bits/stdc++.h> #include <time.h> #define pi acos(-1.0) using namespace std; int main() { // long long begin_time=clock(); // int t; // scanf("%d",&t); // while(t--) // { int n, i, j, flag = 0, x, y = 0, ma = 0, mi = 0x3f3f3f3f; char s[105]; // int a[],b[]; scanf("%d", &n); scanf("%s", s); ...
#include <bits/stdc++.h> #include <time.h> #define pi acos(-1.0) using namespace std; int main() { // long long begin_time=clock(); // int t; // scanf("%d",&t); // while(t--) // { int n, i, j, flag = 0, x, y = 0, ma = 0, mi = 0x3f3f3f3f; char s[105]; // int a[],b[]; scanf("%d", &n); scanf("%s", s); ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
135
n=int(input()) s=input() if len(s)==n: print(s) else: print(s[:n],end='') print('...')
n=int(input()) s=input() if len(s)<=n: print(s) else: print(s[:n],end='') print('...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
46
#include <iostream> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (k >= s.length()) cout << s << endl; else { for (int i = 0; i < 7; i++) cout << s[i]; cout << "..." << endl; } }
#include <iostream> using namespace std; int main() { string s; int k; cin >> k; cin >> s; if (k >= s.length()) cout << s << endl; else { for (int i = 0; i < k; i++) cout << s[i]; cout << "..." << endl; } }
[["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 13], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22]]
1
74
#include <bits/stdc++.h> using namespace std; void oj() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif return; } int main() { // oj(); int n; string s; cin >> n >> s; for (int i = 0; i < s....
#include <bits/stdc++.h> using namespace std; void oj() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif return; } int main() { // oj(); int n; string s; cin >> n >> s; for (int i = 0; i < s....
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94]]
1
130
#include <iostream> #include <string> using namespace std; int main(void) { int k; string s; cin >> k >> s; if (s.length() < k) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main(void) { int k; string s; cin >> k >> s; if (s.length() < k + 1) { cout << s << endl; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } return 0; }
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
82
#include <bits/stdc++.h> using namespace std; #define ll long long #define LI list<int> #define vct vector #define vi vct<int> #define pii pair<int, int> #define pll pair<ll, ll> #define vvi vct<vi> #define vll vct<ll> #define vvll vct<vll> #define all(a) a.begin(), a.end() #define mp(a, b) make_pair(a, b) #define pb p...
#include <bits/stdc++.h> using namespace std; #define ll long long #define LI list<int> #define vct vector #define vi vct<int> #define pii pair<int, int> #define pll pair<ll, ll> #define vvi vct<vi> #define vll vct<ll> #define vvll vct<vll> #define all(a) a.begin(), a.end() #define mp(a, b) make_pair(a, b) #define pb p...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
160
k = int(input()) s = input() print(s if len(s) <= k else "{}...".format(s[:7]))
k = int(input()) s = input() print(s if len(s) <= k else "{}...".format(s[:k]))
[["-", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 22]]
5
37
k = int(input()) s = str(input()) if len(s) < k: print(s) else: print(s[0:k] + '...')
k = int(input()) s = str(input()) 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
43
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() < K) { cout << S << endl; } else { S.erase(K); cout << S << "..." << endl; ; } }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; ++i) using namespace std; int main() { int K; string S; cin >> K >> S; if (S.size() <= K) { cout << S << endl; } else { S.erase(K); cout << S << "..." << endl; ; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
71
#include <iostream> #include <string> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int n = s.size(); if (n < k) cout << s << endl; else cout << s.substr(0, k) << "..." << endl; }
#include <iostream> #include <string> using namespace std; int main() { int k; cin >> k; string s; cin >> s; int n = s.size(); if (n <= k) cout << s << endl; else cout << s.substr(0, k) << "..." << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
67
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #define endl "\n" using namespace std; void FastInput() { ios_base::sync_with_stdio(false); cin.tie(NULL); } ...
#include <algorithm> #include <climits> #include <cmath> #include <deque> #include <fstream> #include <iostream> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_set> #define endl "\n" using namespace std; void FastInput() { ios_base::sync_with_stdio(false); cin.tie(NULL); } ...
[["-", 0, 1, 0, 16, 12, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 12, 16, 12, 5, 0, 6]]
1
125
#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, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { string s; int k, tmp; cin >> k >> s; if (s.length() > k) { cout << s.substr(0, 7) << "..." << endl; } else { cout << s << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { string s; long unsigned int k; cin >> k >> s; if (s.length() > k) { cout << s.substr(0, k) << "..." << endl; } else { cout << s << endl; } return 0; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 87], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
67
import static java.lang.Math.*; import java.io.*; import java.util.*; public class Main { public static class pair implements Comparable<pair> { int l; int r; int dif; public pair(int lef, int ri) { l = lef; r = ri; dif = r - l; } @Override public int compareTo(pair...
import static java.lang.Math.*; import java.io.*; import java.util.*; public class Main { public static class pair implements Comparable<pair> { int l; int r; int dif; public pair(int lef, int ri) { l = lef; r = ri; dif = r - l; } @Override public int compareTo(pair...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
724
#N, M = map(int, input().split()) #A = list(map(int, input().split())) K = int(input()) S = str(input()) if len(S) <= K: print(S) else: x = S[0:7] print(x + "...")
#N, M = map(int, input().split()) #A = list(map(int, input().split())) K = int(input()) S = str(input()) if len(S) <= K: print(S) else: x = S[0:K] print(x + "...")
[["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 22]]
5
48
#include <iostream> #include <math.h> #include <string> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.length() <= k) cout << s; else for (int i = 0; i < k; i++) { cout << s[i]; } cout << "…"; return 0; }
#include <iostream> #include <math.h> #include <string> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (s.length() <= k) cout << s; else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } return 0; }
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; string S; cin >> S; if (S.length() < K) { cout << S; return 0; } cout << S.substr(0, K) << "..."; }
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; string S; cin >> S; if (S.length() <= K) { cout << S; return 0; } cout << S.substr(0, K) << "..."; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
60
#include <bits/stdc++.h> using namespace std; #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.t...
#include <bits/stdc++.h> using namespace std; #define int long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); \ cout.t...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
189
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> #pragma warning(disable : 4996) #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int k; ...
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <math.h> #include <stdio.h> #include <string> #include <unordered_map> #include <vector> #pragma warning(disable : 4996) #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; int main() { int k; ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
115
//#include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using na...
//#include <bits/stdc++.h> #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdint> #include <cstdio> #include <cstring> #include <ctime> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using na...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
3,516
k = int(input()) s = input() l = len(s) S = s[:k] if l >= k: print(S+'...') else: print(s)
k = int(input()) s = input() l = len(s) S = s[:k] if l > k: print(S+'...') else: print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
45
k = int(input()) s_num = input() s = list(s_num) if len(s) < k: ans = s_num else: ans = s_num[0:k] + "..." print(ans)
k = int(input()) s_num = input() s = list(s_num) if len(s) <= k: ans = s_num else: ans = s_num[0:k] + "..." print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
48
import numpy as np import itertools K = int(input()) S = input() if K > len(S): print(S) else: print(S[:K], end='') print("...")
import numpy as np import itertools K = int(input()) S = input() if K >= len(S): print(S) else: print(S[:K], end='') print("...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
52
n=int(input()) s=input() if n>=len(s): print(s) else: print(s[:-(n+1)]+"...")
n=int(input()) s=input() if n>=len(s): print(s) else: print(s[:n]+"...")
[["-", 0, 657, 31, 206, 206, 663, 0, 664, 17, 33], ["-", 31, 206, 206, 663, 0, 664, 28, 23, 0, 24], ["-", 206, 663, 0, 664, 28, 23, 0, 657, 17, 72], ["-", 206, 663, 0, 664, 28, 23, 0, 657, 12, 612], ["-", 31, 206, 206, 663, 0, 664, 28, 23, 0, 25]]
5
44
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)n; i++) using namespace std; int main() { ll K; string S; ci...
#include <algorithm> #include <cmath> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <string> #include <vector> #define ll long long #define rep(i, n) for (ll i = 0; i < (ll)n; i++) using namespace std; int main() { ll K; string S; ci...
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
94
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) /// 1<<3シフト演算子 とは 0001の1を三つずらして1000にする, /// これは8を表しておりつまりbitは0から7まで #define all(x) (x).begin(), (x).end() #define cyes cout << "YES" << endl #define cno cout << "NO" << endl #define sp << " " << #define CST(x) cout << fixed << setprecision(x) #defi...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) /// 1<<3シフト演算子 とは 0001の1を三つずらして1000にする, /// これは8を表しておりつまりbitは0から7まで #define all(x) (x).begin(), (x).end() #define cyes cout << "YES" << endl #define cno cout << "NO" << endl #define sp << " " << #define CST(x) cout << fixed << setprecision(x) #defi...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
137
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i) for (cin >> i; i > 0; i--) #define elif else if #define pb push_back #define ll long long #define mp make_pair #define all(x) x.begin(), x.end() #define re(x) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define FOR(i) for (cin >> i; i > 0; i--) #define elif else if #define pb push_back #define ll long long #define mp make_pair #define all(x) x.begin(), x.end() #define re(x) ...
[["+", 64, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 2, 3, 4, 0, 16, 12, 5, 0, 62], ["+", 0, 2, 3, 4, 0, 16, 12, 5, 0, 6]]
1
105
#include <bits/stdc++.h> #define eps 1e-3 #define pi acos(-1.0) #define inf 0x3f #define INF 0x3f3f3f3f #define pb push_back #define debug1 cout << "&&"; #define debug2 cout << "**"; #define ms(a, x) memset(a, x, sizeof(a)) #define for0(i, n) for (int i = 0; i < n; ++i) #define for1(i, n) for (int i = 1; i <= n; ++i) u...
#include <bits/stdc++.h> #define eps 1e-3 #define pi acos(-1.0) #define inf 0x3f #define INF 0x3f3f3f3f #define pb push_back #define debug1 cout << "&&"; #define debug2 cout << "**"; #define ms(a, x) memset(a, x, sizeof(a)) #define for0(i, n) for (int i = 0; i < n; ++i) #define for1(i, n) for (int i = 1; i <= n; ++i) u...
[["-", 0, 16, 31, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 16, 31, 2, 3, 4, 0, 16, 12, 13]]
1
185
k=int(input()) s=input() print(S[:K]) if len(S) <= K else print(S[:K] + "...")
K=int(input()) S=input() print(S[:K]) if len(S) <= K else print(S[:K] + "...")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22]]
5
41
#include <iostream> #include <string> int main() { std::uint16_t k = 0; std::cin >> k; std::string s; std::cin >> s; if (s.size() <= k) std::cout << s; else std::cout << s[0] << "..."; return 0; }
#include <iostream> #include <string> int main() { std::uint16_t k = 0; std::cin >> k; std::string s; std::cin >> s; if (s.size() <= k) std::cout << s; else std::cout << s.substr(0, k) << "..."; return 0; }
[["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["+", 0, 16, 31, 16, 12, 2, 63, 118, 17, 131], ["+", 0, 16, 31, 16, 12, 2, 63, 118, 119, 120], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 16, 31, 16, 12, 69, 341, 342, 0, 73], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 21], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+"...
1
67
k=int(input()) s=input() n=len(s) if k>n: print(s[:k+1]+"...") else: print(s)
k=int(input()) s=input() n=len(s) if n>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, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
44
def main(): K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[0:7]+"...") #a = list(map(int, input().split())) #print(a) if __name__ == '__main__': main()
def main(): K = int(input()) S = input() if len(S) <= K: print(S) else: print(S[0:K]+"...") #a = list(map(int, input().split())) #print(a) if __name__ == '__main__': main()
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
57
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int k; cin >> k; string s; cin >> s; int n = s.size(); if (n >= k) { for (int i = 0; i < k; i++) cout << s[i]; cout << "..."; } else cout << s; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { // your code goes here int k; cin >> k; string s; cin >> s; int n = s.size(); if (n > k) { for (int i = 0; i < k; i++) cout << s[i]; cout << "..."; } else cout << s; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
79
#include <algorithm> #include <iostream> #include <list> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int a; string str; cin >> a >> str; if (a > str.length()) { cout << str << endl; return 0; } cout << str.substr(0, a) + "..." << endl; }
#include <algorithm> #include <iostream> #include <list> #include <stdio.h> #include <string> #include <vector> using namespace std; int main() { int a; string str; cin >> a >> str; if (a >= str.length()) { cout << str << endl; return 0; } cout << str.substr(0, a) + "..." << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
72
k=int(input()) s=input() n=len(s) if s<=k: print(s) else: print(s[:k]+'...')
k=int(input()) s=input() n=len(s) if n<=k: print(s) else: print(s[:k]+'...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; int slength = (int)(s.length()); if (slength <= k) { cout << s << endl; } else { s = s.substr(k); cout << s << "..." << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k; string s; cin >> k; cin >> s; int slength = (int)(s.length()); if (slength <= k) { cout << s << endl; } else { s = s.substr(0, k); cout << s << "..." << endl; } return 0; }
[["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21]]
1
79
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 ll n, k; int t; ll m, M; int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); // #endif cin >> k; string str; cin >> str; if (str.size() <= k) { c...
#include <bits/stdc++.h> using namespace std; #define ll long long #define MOD 1000000007 ll n, k; int t; ll m, M; int main() { // #ifndef ONLINE_JUDGE // freopen("input.txt", "r", stdin); // freopen("output.txt", "w", stdout); // #endif cin >> k; string str; cin >> str; if (str.size() <= k) { c...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]]
1
93
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int K; string S; cin >> K; cin >> S; if (S.size() < ...
#include <algorithm> #include <functional> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; int main(void) { int K; string S; cin >> K; cin >> S; if (S.size() <=...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
90
K = int(input()) S = input() N = len(S) if N < K: print(S) else: print(S[0:K], end='') print('...')
K = int(input()) S = input() N = len(S) if N <= K: print(S) else: print(S[0:K], end='') print('...')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
50
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func nextInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } func main() { sc.Split(bufio.ScanWords) k := nextInt() s := nextStr() if len(s) < k { fmt.Println(s) } else {...
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func nextInt() int { sc.Scan() i, e := strconv.Atoi(sc.Text()) if e != nil { panic(e) } return i } func main() { sc.Split(bufio.ScanWords) k := nextInt() s := nextStr() if len(s) <= k { fmt.Println(s) } else ...
[["-", 0, 435, 8, 196, 0, 57, 15, 16, 17, 18], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 17, 19]]
7
167
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef unsigned long long ull; typedef long long ll; #define big ((ll)(1e9) + 7) int main() { int k; cin >> k; string s; cin >> s; boo...
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <limits> #include <stdio.h> #include <string> #include <vector> using namespace std; typedef unsigned long long ull; typedef long long ll; #define big ((ll)(1e9) + 7) int main() { int k; cin >> k; string s; cin >> s; boo...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
123
#include <algorithm> #include <bits/stdc++.h> #include <math.h> #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define INF 999999999 #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); using llong = long long; using namespace std; int main() { string s; llong k; cin >> k >> s; ll...
#include <algorithm> #include <bits/stdc++.h> #include <math.h> #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define INF 999999999 #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); using llong = long long; using namespace std; int main() { string s; llong k; cin >> k >> s; ll...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
98
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int num; string str1; cin >> num; cin >> str1; if (str1.length() < num) { cout << str1; } else { for (int i = 0; i < num; i++) { cout << str1[i]; } cout << "..."; } }
#include <algorithm> #include <iostream> #include <string> using namespace std; int main() { int num; string str1; cin >> num; cin >> str1; if (str1.length() <= num) { cout << str1; } else { for (int i = 0; i < num; i++) { cout << str1[i]; } cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
78
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; if (s.length() == n) cout << s; else { for (int i = 0; i < n; i++) cout << s[i]; cout << "..."; } }
#include <iostream> using namespace std; int main() { int n; cin >> n; string s; cin >> s; // cout<<s.length(); if (s.length() <= n) cout << s; else { for (int i = 0; i < n; i++) cout << s[i]; cout << "..."; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
70
K = int(input()) S = input() l = len(S) if l <= K: print(S) else: SS = S[:K]+"…" print(SS)
K = int(input()) S = input() l = len(S) if l <= K: print(S) else: SS = S[:K]+"..." print(SS)
[["-", 0, 1, 0, 662, 12, 657, 12, 557, 0, 6], ["+", 0, 1, 0, 662, 12, 657, 12, 557, 0, 6]]
5
45
#include <iostream> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (k <= (int)s.length()) { cout << s; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } return 0; }
#include <iostream> using namespace std; int main() { int k; cin >> k; string s; cin >> s; if (k >= (int)s.length()) { cout << s; } else { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..."; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
80
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if ((int)s.size() < k) { cout << s; return 0; } cout << s.erase(k) << "..."; return 0; }
#include <algorithm> #include <iostream> #include <math.h> #include <string> #include <vector> using namespace std; int main() { int k; string s; cin >> k; cin >> s; if ((int)s.size() <= k) { cout << s; return 0; } cout << s.erase(k) << "..."; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
72
n=int(input()) s=input() if len(s) < n: print(s) else: s=s[:n] s += '...' print(s)
n=int(input()) s=input() if len(s) <= n: print(s) else: s=s[:n] s += '...' print(s)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
43
def solve(): K = int(input()) S = input() if len(S) < K: print(S) exit() for i in range(K): print(S[i], end="") print('...') solve()
def solve(): K = int(input()) S = input() if len(S) <= K: print(S) exit() for i in range(K): print(S[i], end="") print('...') solve()
[["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 19]]
5
62
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define revp(i, b, a) for (int i = b; i >= a; i--) #define endl '\n' #define ll long long int int n; string s; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cin >> n >> s; if (s.length() < n) cout ...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = a; i <= b; i++) #define revp(i, b, a) for (int i = b; i >= a; i--) #define endl '\n' #define ll long long int int n; string s; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cin >> n >> s; if (s.length() <= n) cout...
[["-", 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> #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() { string s; int k, l; cin >> k; cin >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) cout << s[i]; } cout << "..." << endl; ret...
#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() { string s; int k; cin >> k; cin >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) cout << s[i]; cout << "..." << endl; } retu...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
95
#include <bits/stdc++.h> using namespace std; #define int long long int #define loop for (int i = 0; i < n; i++) #define pb push_back int32_t main() { int n; cin >> n; string s; cin >> s; if (s.size() < n) cout << s << endl; else cout << s.substr(0, n) << "..."; }
#include <bits/stdc++.h> using namespace std; #define int long long int #define loop for (int i = 0; i < n; i++) #define pb push_back int32_t main() { int n; cin >> n; string s; cin >> s; if (s.size() <= n) cout << s << endl; else cout << s.substr(0, n) << "..."; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
67
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; string s; cin >> s; if (s.size() <= x) cout << s << endl; else { for (int i = 0; i < x; i++) { cout << s[i]; } cout << ".../n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; string s; cin >> s; if (s.size() <= x) cout << s << endl; else { for (int i = 0; i < x; i++) { cout << s[i]; } cout << "..."; } return 0; }
[["-", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { char cc[110]; int i, j, k, l; cin >> k; cin >> cc + 1; l = strlen(cc + 1); for (i = 1; i <= l; i++) { if (i <= k) cout << cc[i]; else cout << "."; } }
#include <bits/stdc++.h> using namespace std; int main() { char cc[110]; int i, j, k, l; cin >> k; cin >> cc + 1; l = strlen(cc + 1); for (i = 1; i <= l; i++) { if (i <= k) cout << cc[i]; else { cout << "..."; break; } } }
[["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
81
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <deque> // deque #include <iostream> // cout, endl, cin ...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
210
#pragma comment(linker, "/STACK:128777216") #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <algorithm> #include <bitset> #include <deque> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <cmath> #include <cstring> #include <math.h> #incl...
#pragma comment(linker, "/STACK:128777216") #include <cstdio> #include <cstdlib> #include <iostream> #include <sstream> #include <algorithm> #include <bitset> #include <deque> #include <map> #include <queue> #include <set> #include <stack> #include <vector> #include <cmath> #include <cstring> #include <math.h> #incl...
[["+", 0, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["+", 0, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["+", 0, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 25]]
1
380
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
#include <algorithm> #include <bits/stdc++.h> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #includ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
1,214
K=int(input()) S=input() if K>=len(S): print(S) else: print(S[0:7]+str("..."))
K=int(input()) S=input() if K>=len(S): print(S) else: print(S[0:K]+str("..."))
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
43
def main(): k = int(input()) s = input() val = len(s)-k if val > 0: print(s[:k]+'...') if __name__ == '__main__': main()
def main(): k = int(input()) s = input() val = len(s)-k if val > 0: print(s[:k] + '...') else: print(s) if __name__ == '__main__': main()
[["+", 0, 14, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 14, 8, 196, 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
53
k=int(input()) s=input() l=len(s) if l<=k: print(s) else: n=s[0:k] print(n)
k=int(input()) s=input() l=len(s) if l<=k: print(s) else: n=s[0:k] print(n+'...')
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 655]]
5
42
k = int(input()) n = input() if len(n)>k: print(n+'...') else: print(n)
k = int(input()) n = input() if len(n)>k: print(n[:k]+'...') else: print(n)
[["+", 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
35
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define MOOD 1000000007 using namespace std; using ll = long long; using P = pair<int, int>; int cmpnum(const voi...
#include <algorithm> #include <iostream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <vector> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) #define MOOD 1000000007 using namespace std; using ll = long long; using P = pair<int, int>; int cmpnum(const voi...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
1,230
K = int(input()) S = str(input()) if len(S) <= K: print(S) else: print(S[:7] + '...')
K = int(input()) S = str(input()) if len(S) <= K: print(S) else: print(S[:K] + '...')
[["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]]
5
42
k = int(input()) s = str(input()) if len(s) == k: print(s) else: print(s[:k] + "...")
k = int(input()) s = str(input()) if len(s) <= k: print(s) else: print(s[:k] + "...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string str; cin >> str; if (str.size() >= N) { str.erase(N); cout << str + "..." << endl; } else cout << str << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; string str; cin >> str; if (str.size() > N) { str.erase(N); cout << str + "..." << endl; } else cout << str << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]]
1
62
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define INF 0x3f3f3f3f t...
#include <bits/stdc++.h> using namespace std; #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define fi first #define se second #define SZ(x) ((int)(x).size()) #define INF 0x3f3f3f3f t...
[["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25]]
1
249
k = int(input()) s = input() if (k > len(s)): print(s) else: kotae = [] for i in range(k): kotae.append(s[i]) kotae.append("...") kotae2 = "".join(kotae) print(kotae2)
k = int(input()) s = input() if (k >= len(s)): print(s) else: kotae = [] for i in range(k): kotae.append(s[i]) kotae.append("...") kotae2 = "".join(kotae) print(kotae2)
[["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]]
5
71
#import numpy as np #a,b,c=map(int,input().split()) z=int(input()) a=input() if len(a)>z: b=a[:z] print(b+"...") else: print(b)
#import numpy as np #a,b,c=map(int,input().split()) z=int(input()) a=input() if len(a)>z: b=a[:z] print(b+"...") else: print(a)
[["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
44
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(v) v.rbegin(), v.rend() #define ones(x) __builtin_popcount(x) #define sz(v) ((int)((v).size()) #define debug(x) cout << '>' << #x << ':' << x << endl; #define clr(v, d) memset(v, d, sizeof(v)); #define rep(i, a, b) for (ll i = a; i <...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rall(v) v.rbegin(), v.rend() #define ones(x) __builtin_popcount(x) #define sz(v) ((int)((v).size()) #define debug(x) cout << '>' << #x << ':' << x << endl; #define clr(v, d) memset(v, d, sizeof(v)); #define rep(i, a, b) for (ll i = a; i <...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
432
n=int(input()) s=input() l=len(s); if l<=n: print(s) else: print(s[0:l-n-1]+"...");
n=int(input()) s=input() l=len(s); if l<=n: print(s) else: print(s[0:n]+"...");
[["-", 31, 206, 206, 663, 0, 657, 31, 657, 31, 22], ["-", 31, 206, 206, 663, 0, 657, 31, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]]
5
49
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi 3.14159265359 int main() { int K; cin >> K; string S; cin >> S; if (S.size() <= K) { cout << S; } else { for (int i = 0; i < S.size(); i++) { if (i <= K) { cout << S.at(i); } el...
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pi 3.14159265359 int main() { int K; cin >> K; string S; cin >> S; if (S.size() <= K) { cout << S; } else { for (int i = 0; i < S.size(); i++) { if (i < K) { cout << S.at(i); } els...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
106
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; string SS; if (S.size() < K) { SS = S; } else { for (int i = 0; i < K; ++i) { SS.push_back(S.at(i)); } SS += "..."; } cout << SS << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int K; string S; cin >> K >> S; string SS; if (S.size() <= K) { SS = S; } else { for (int i = 0; i < K; ++i) { SS.push_back(S.at(i)); } SS += "..."; } cout << SS << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
89
k = int(input()) s = list(input()) if len(s) < k: ans = ''.join(s) else: ans = ''.join(s[0:k])+"..." print(ans)
k = int(input()) s = list(input()) if len(s) <= k: ans = ''.join(s) else: ans = ''.join(s[0:k])+"..." print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
57
#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++) int main() { int k; cin >> k; string s; cin >> s; if (s.length() < k) { cout << s << endl; } else { cout << s.substr(0, k) << "..." << endl...
#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++) int main() { int k; cin >> k; string s; cin >> s; if (s.length() <= k) { cout << s << endl; } else { cout << s.substr(0, k) << "..." << end...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
85
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; n > i; ++i) using namespace std; using ll = long long; using P = pair<int, int>; // pとqの最大公約数 int gcd(int p, int q) { if (p % q == 0) return q; return gcd(q, p % q); } int main() { int k; string s; cin >> k >> s; int a = s.size(); if (a <= k) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; n > i; ++i) using namespace std; using ll = long long; using P = pair<int, int>; // pとqの最大公約数 int gcd(int p, int q) { if (p % q == 0) return q; return gcd(q, p % q); } int main() { int k; string s; cin >> k >> s; int a = s.size(); if (a <= k) ...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
137
k = gets.chop.to_i s = gets.chop.split('') if s.count < k puts s.join else puts s.slice(0..k-1).join + '...' end
k = gets.chop.to_i s = gets.chop.split('') if s.count <= k puts s.join else puts s.slice(0..k-1).join + '...' end
[["-", 36, 36, 0, 493, 0, 121, 15, 738, 17, 18], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 19]]
4
47
#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; string s; cin >> k >> s; int n = (int)s.size(); if (n <= k) { cout << s << endl; } else { cout << s.substr(0, n) << "..." << endl; } ...
#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; string s; cin >> k >> s; int n = (int)s.size(); if (n <= k) { cout << s << endl; } else { cout << s.substr(0, k) << "..." << endl; } ...
[["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]]
1
97
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int sx = s.length(); if (k > sx) { System.out.println(s); } else { System.out.println(s.substring(0, k) + "..."...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); String s = sc.next(); int sx = s.length(); if (k >= sx) { System.out.println(s); } else { System.out.println(s.substring(0, k) + "......
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20]]
3
102
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; int k; cin >> k >> s; if (s.size() > k) { for (int i = 0; i < s.size(); i++) { cout << s[i]; } cout << "..." << endl; } else { cout << s << endl; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { string s; int k; cin >> k >> s; if (s.size() > k) { for (int i = 0; i < k; i++) { cout << s[i]; } cout << "..." << endl; } else { cout << s << endl; } }
[["-", 0, 7, 15, 16, 12, 2, 63, 118, 28, 22], ["-", 0, 7, 15, 16, 12, 2, 63, 118, 17, 131], ["-", 0, 7, 15, 16, 12, 2, 63, 118, 119, 120], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 24], ["-", 0, 7, 15, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]]
1
86
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typedef pair<ll...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define fi first #define se second #define mp make_pair #define pb push_back #define fbo find_by_order #define ook order_of_key typedef long long ll; typedef pair<ll...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
159
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; int main() { ll k; string s; cin >> k >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) cout << s[i]; } cout << "..." << endl; ...
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) using namespace std; typedef long long ll; int main() { ll k; string s; cin >> k >> s; if (s.size() <= k) cout << s << endl; else { rep(i, k) cout << s[i]; cout << "..." << endl; } ...
[["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]]
1
86
k=int(input()) s=input() if(len(s)>k): result=s[:7]+'...' print(result) else: print(s)
k=int(input()) s=input() if(len(s)>k): result=s[:k]+'...' print(result) else: print(s)
[["-", 0, 662, 12, 657, 31, 206, 206, 663, 0, 612], ["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22]]
5
44
#include <stdio.h> #include <string.h> int main() { int k; char s[101]; scanf("%s", s); if (strlen(s) <= k) printf("%s\n", s); else { for (int i = 0; i < k; i++) printf("%c", s[i]); printf("...\n"); } return 0; }
#include <stdio.h> #include <string.h> int main() { int k; char s[101]; scanf("%d%s", &k, s); if (strlen(s) <= k) printf("%s\n", s); else { for (int i = 0; i < k; i++) printf("%c", s[i]); printf("...\n"); } return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22]]
0
87
#include <bits/stdc++.h> #include <cmath> #define pb push_back #define ld long double #define mp make_pair #define vl vector<ll> #define ll long long int #define pl pair<ll, ll> #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define forr(i, n) for (ll i = 0; i < n; i++) #define forr1(i,...
#include <bits/stdc++.h> #include <cmath> #define pb push_back #define ld long double #define mp make_pair #define vl vector<ll> #define ll long long int #define pl pair<ll, ll> #define min3(a, b, c) min(a, min(b, c)) #define max3(a, b, c) max(a, max(b, c)) #define forr(i, n) for (ll i = 0; i < n; i++) #define forr1(i,...
[["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 37, 0, 38], ["+", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46]]
1
174
K = int(input()) S = str(input()) if len(S) == K: print(K) if len(S) > K: print(S[:K]+"...")
K = int(input()) S = str(input()) if len(S) <= K: print(S) if len(S) > K: print(S[:K]+"...")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]]
5
48