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 |
|---|---|---|---|---|
k=int(input())
s=list(input())
ss=("").join(s)
S=len(s)
sss=("").join(s[0:7])
if S<=k:
print(ss)
else:
print(sss+("...")) | k=int(input())
s=list(input())
ss=("").join(s)
S=len(s)
sss=("").join(s[0:k])
if S<=k:
print(ss)
else:
print(sss+("...")) | [["-", 12, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 12, 652, 3, 4, 0, 206, 206, 663, 0, 22]] | 5 | 70 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
// cout<<s.size()<<endl;
if (s.size() >= n) {
string k = s.substr(0, n);
cout << k << "...";
} else
cout << s;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
// cout<<s.size()<<endl;
if (s.size() > n) {
string k = s.substr(0, n);
cout << k << "...";
} 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 | 67 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
int cnt = 0;
for (int i = 0; i < s.length(); i++) {
cnt++;
}
if (cnt < k) {
cout << s << endl;
} else {
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
}
re... | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
int cnt = 0;
for (int i = 0; i < s.length(); i++) {
cnt++;
}
if (cnt <= k) {
cout << s << endl;
} else {
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
}
re... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 103 |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int size, sizecad, i;
scanf("%d", &size);
char *cadena = (char *)malloc(size + 1);
scanf("%s", cadena);
sizecad = sizeof(cadena);
if (sizecad >= size) {
for (i = 0; i < size; i++) {
printf("%c", cadena[i]);
}
printf(".... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int size, sizecad, i;
scanf("%d", &size);
char *cadena = (char *)malloc(100);
scanf("%s", cadena);
sizecad = strlen(cadena);
if (sizecad > size) {
for (i = 0; i < size; i++) {
printf("%c", cadena[i]);
}
printf("...");
... | [["-", 51, 74, 51, 2, 3, 4, 0, 16, 31, 22], ["-", 51, 74, 51, 2, 3, 4, 0, 16, 17, 72], ["-", 51, 74, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 74, 51, 2, 3, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 105, 0, 150], ["+", 8, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 1... | 0 | 132 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <u... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <ciso646>
#include <cmath>
#include <complex>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <u... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 308 |
K=int(input())
S=list(input())
T=int(len(S))
if T>K:
X=S[0:7]
Y=str("".join(X))
Z=str("...")
print(Y+Z)
else:
print("".join(S))
| K=int(input())
S=list(input())
T=int(len(S))
if T>K:
X=S[0:K]
Y=str("".join(X))
Z=str("...")
print(Y+Z)
else:
print("".join(S))
| [["-", 0, 1, 0, 662, 12, 206, 206, 663, 0, 612], ["+", 0, 1, 0, 662, 12, 206, 206, 663, 0, 22]] | 5 | 76 |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int K;
string S;
cin >> K >> S;
if (K > S.size())
cout << S << endl;
else {
while (S.size() > K)
S.pop_back();
S += "...";
cout << S << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long int K;
string S;
cin >> K >> S;
if (K >= S.size())
cout << S << endl;
else {
while (S.size() > K)
S.pop_back();
S += "...";
cout << S << endl;
}
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 73 |
K = int(input())
S = input()
if len(S) > K:
S = S[:k] + "..."
print(S)
else:
print(S) | K = int(input())
S = input()
if len(S) > K:
S = S[:K] + "..."
print(S)
else:
print(S) | [["-", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22], ["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 22]] | 5 | 42 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int k;
string s;
cin >> k >> s;
string ans;
if (s.size() <= k) {
ans = s;
} else {
ans = s.substr(0, 7);
ans += "...";
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int k;
string s;
cin >> k >> s;
string ans;
if (s.size() <= k) {
ans = s;
} else {
ans = s.substr(0, k);
ans += "...";
}
cout << ans << endl;
return 0;
} | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 77 |
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
ll k, N;
string s;
cin >> k >> s;
N = (ll)(s.length())... | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#define ll long long int
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
int main() {
ll k, N;
string s;
cin >> k >> s;
N = (ll)(s.length())... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 31, 16, 31, 16, 12, 2, 63, 118, 119, 120], ["+", 31, 16, 31, 16, 12, 2, 63, 118, 119, 120], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 21]] | 1 | 101 |
k = int(input())
s = str(input())
S = len(s)
if 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, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]] | 5 | 45 |
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
class pqComp {
public:
bool operator()(pair<int, int> &a, pair<int, int> &b) {
return a.second < b.second;
}
}... | #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
class pqComp {
public:
bool operator()(pair<int, int> &a, pair<int, int> &b) {
return a.second < b.second;
}
}... | [["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 21]] | 1 | 188 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int K;
string S;
cin >> K >> S;
if (S.size() <= K)
cout << S << endl;
else {
rep(i, K) { cout << S.at(i); }
cout << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int K;
string S;
cin >> K >> S;
if (S.size() <= K)
cout << S << endl;
else {
rep(i, K) { cout << S.at(i); }
cout << "..." << endl;
}
} | [["+", 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 | 72 |
#include <stdio.h>
int main(void) {
char s[100];
int k, i, n;
scanf("%d", &k);
scanf("%s", s);
n = 0;
while (s[n] != '\0') {
n++;
}
if (n < k) {
for (i = 0; i < n; i++) {
printf("%c", s[i]);
}
printf("\n");
} else {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
... | #include <stdio.h>
int main(void) {
char s[100];
int k, i, n;
scanf("%d", &k);
scanf("%s", s);
n = 0;
while (s[n] != '\0') {
n++;
}
if (n <= k) {
for (i = 0; i < n; i++) {
printf("%c", s[i]);
}
printf("\n");
} else {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
... | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]] | 0 | 144 |
#include <iostream>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
if (S.size() <= K) {
cout << S << endl;
return 0;
} else {
for (int i = 0; i < K; i++) {
cout << S.at(i);
}
}
cout << "…" << endl;
} | #include <iostream>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
if (S.size() <= K) {
cout << S << endl;
return 0;
} else {
for (int i = 0; i < K; i++) {
cout << S.at(i);
}
}
cout << "..." << endl;
} | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 81 |
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <class S, class T>
ostream &op... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <class S, class T>
ostream &op... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 668 |
#標準入力
#整数一文字の場合
n = gets.to_i
s = gets.to_s
if s.length <= n then
puts s
else
s = s.slice(0..n-1) + "..."
puts s
end
| n = gets.to_i
s = gets.to_s.chomp
if s.length <= n then
puts s
else
s = s.slice(0..n-1) + "..."
puts s
end
| [["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 41 |
def solve():
K = int(input())
S = input()
if len(S) > K:
print("{}...".format(S[:7]))
else:
print(S)
if __name__ == "__main__":
solve() | def solve():
K = int(input())
S = input()
if len(S) > K:
print("{}...".format(S[:K]))
else:
print(S)
if __name__ == "__main__":
solve() | [["-", 0, 652, 3, 4, 0, 206, 206, 663, 0, 612], ["+", 0, 652, 3, 4, 0, 206, 206, 663, 0, 22]] | 5 | 57 |
#include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int k;
std::string s;
cin >> k;
cin >> s;
/*
int a[n];
std::vector<int> v;
for(int i=0; i<n; i++){
int tmp;
cin >> tmp;
a[i] = tmp;
}
*/
if (s.size() <= k) {
cout << ... | #include <algorithm>
#include <iostream>
#include <map>
#include <vector>
using namespace std;
int main() {
int k;
std::string s;
cin >> k;
cin >> s;
/*
int a[n];
std::vector<int> v;
for(int i=0; i<n; i++){
int tmp;
cin >> tmp;
a[i] = tmp;
}
*/
if (s.size() <= k) {
cout << ... | [["-", 31, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 31, 16, 12, 2, 3, 4, 0, 22]] | 1 | 73 |
/*
vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう
だけど面倒
vfillの範囲指定をできるようにしたい
*/
//#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
////Optimization flags #pragma GCC
//option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC
//target("avx") //Enable AVX
#pragma GCC optimize("Ofast")
... | /*
vectorの配列を吐き出す関数はvfillと同じ要領で簡潔に書けそう
だけど面倒
vfillの範囲指定をできるようにしたい
*/
//#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
////Optimization flags #pragma GCC
//option("arch=native","tune=native","no-zero-upper") //Enable AVX #pragma GCC
//target("avx") //Enable AVX
#pragma GCC optimize("Ofast")
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 2,886 |
k = int(input())
s = input()
n = len(s)
if len(s) <= k:
print(s)
else:
print(s[:k+1] + '...') | k = int(input())
s = input()
n = len(s)
if len(s) <= k:
print(s)
else:
print(s[:k] + '...')
| [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 47 |
k=int(input())
s=input()
if int(len(s))<=k:
print(s)
else:
print(s[0:7]+'...')
| k=int(input())
s=input()
if int(len(s))<=k:
print(s)
else:
print(s[0:k]+'...')
| [["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 22]] | 5 | 43 |
// Hail god Yato
#include <bits/stdc++.h>
using namespace std;
#define hs \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | // Hail god Yato
#include <bits/stdc++.h>
using namespace std;
#define hs \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0... | [["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 22]] | 1 | 124 |
#include <bits/stdc++.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0); ... | #include <bits/stdc++.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0); ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 71 |
K = int(input())
S = input()
len_S = len(S)
S0 = ''
if len_S<=K:
print(S)
else:
S0 += S[0:7]
S0 +='...'
print(S0) | K = int(input())
S = input()
len_S = len(S)
S0 = ''
if len_S<=K:
print(S)
else:
S0 += S[0:K]
S0 +='...'
print(S0) | [["-", 0, 1, 0, 677, 12, 206, 206, 663, 0, 612], ["+", 0, 1, 0, 677, 12, 206, 206, 663, 0, 22]] | 5 | 51 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string ch = "...";
int limit;
while (cin >> limit) {
string str;
cin >> str;
int size = str.size();
if (size == limit) {
cout << str << '\n';
} else {
string temp;
for (int i = 0; i < limit; i++) {
temp += str... | #include <bits/stdc++.h>
using namespace std;
int main() {
string ch = "...";
int limit;
while (cin >> limit) {
string str;
cin >> str;
int size = str.size();
if (size == limit || size < limit) {
cout << str << '\n';
} else {
string temp;
for (int i = 0; i < limit; i++) {
... | [["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]] | 1 | 103 |
#include <bits/stdc++.h>
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.at(i);
cout << "..." << endl;
}
return 0;
} | #include <bits/stdc++.h>
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.at(i);
cout << "..." << endl;
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 79 |
n = gets.to_i
s = gets.chomp
if s.length<=k
puts s
else
puts s[0...k]+"..."
end | k = gets.to_i
s = gets.chomp
if s.length<=k
puts s
else
puts s[0...k]+"..."
end | [["-", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22]] | 4 | 31 |
#include <bits/stdc++.h>
/* #define int long long */
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
typedef pair<int, int> P;
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define MOD 10000... | #include <bits/stdc++.h>
/* #define int long long */
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define repa(i, s, n) for (int i = s; i < (int)n; i++)
using namespace std;
using ll = long long;
typedef vector<int> vi;
typedef pair<int, int> P;
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define MOD 10000... | [["-", 0, 1, 0, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 31, 2, 3, 4, 0, 22]] | 1 | 190 |
K = int(input())
S = input()
ls = len(S)
if ls <= K:
print(S)
else:
print(S[:K]) | K = int(input())
S = input()
ls = len(S)
if ls <= K:
print(S)
else:
print(S[:K]+"...") | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 655]] | 5 | 38 |
#include <stdio.h>
#include <string.h>
int main(void) {
int k, i;
char s[100];
scanf("%d%s", &k, s);
if (strlen(s) <= k) {
printf("%s\n", s);
} else {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("\n");
}
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
int k, i;
char s[100];
scanf("%d%s", &k, s);
if (strlen(s) <= k) {
printf("%s\n", s);
} else {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...\n");
}
return 0;
} | [["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 95 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#define ll long long
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define loop(i, start, stop) for (int i = start; i < (stop); i++)
using namespace std;
... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#define ll long long
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define loop(i, start, stop) for (int i = start; i < (stop); i++)
using namespace std;
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 102 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()
int main() {
ll K;
cin >> K;
string S;
cin >> S;
if (S.size() <= K) {
cout << S << endl;
} else {
for (ll i = 0; i < K; i++) {
cout << S[i];
}
cout << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(v) v.begin(), v.end()
int main() {
ll K;
cin >> K;
string S;
cin >> S;
if (S.size() <= K) {
cout << S << endl;
} else {
for (ll i = 0; i < K; i++) {
cout << S[i];
}
cout << "..." << 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 | 86 |
K = int(input())
S = input()
sentence=""
if len(S) < K:
print(S)
exit(0)
if K <= len(S):
for i in range(K):
sentence = sentence + S[i]
print(sentence + "...")
| K = int(input())
S = input()
sentence=""
if len(S) <= K:
print(S)
exit(0)
if K < len(S):
for i in range(K):
sentence = sentence + S[i]
print(sentence + "...")
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]] | 5 | 65 |
K = int(input())
S = input()
a = len(S)
if a <= K:
print(S)
else:
print(str(S[0:K]))
| # ABC168
# B (Triple Dots)
K = int(input())
S = input()
a = len(S)
if a <= K:
print(S)
else:
print(str(S[0:K])+'...')
| [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 655]] | 5 | 42 |
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int K;
string S;
cin >> K >> S;
if (S.size() >= K) {
cout << S.substr(0, K) << "..." << endl;
;
} else {
cout << S << endl;
}
}
| #include <iostream>
#include <string>
using namespace std;
int main(void) {
int K;
string S;
cin >> K >> S;
if (S.size() > K) {
cout << S.substr(0, K) << "..." << endl;
;
} else {
cout << S << endl;
}
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 66 |
K = int(input())
str = list(input())
if len(str) <= K:
print("".join(str))
else:
print("".join(str[0:K])) | K = int(input())
str = list(input())
if len(str) <= K:
print("".join(str))
else:
print("".join(str[0:K]) + "...") | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 655]] | 5 | 51 |
#!/usr/bin/env python3
def main():
import sys
input = sys.stdin.readline
K = int(input())
S = input()
if len(S) <= K:
print(S)
else:
print(S[:K] + '...')
if __name__ == '__main__':
main()
| #!/usr/bin/env python3
def main():
import sys
input = sys.stdin.readline
K = int(input())
S = input().rstrip()
if len(S) <= K:
print(S)
else:
print(S[:K] + '...')
if __name__ == '__main__':
main()
| [["+", 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 | 64 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = Integer.parseInt(sc.nextLine());
String strings = sc.nextLine();
if (strings.length() < num) {
System.out.println(strings);
} else {
System.out.prin... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = Integer.parseInt(sc.nextLine());
String strings = sc.nextLine();
if (strings.length() <= num) {
System.out.println(strings);
} else {
System.out.prin... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 102 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Integer maxLength = Integer.parseInt(sc.nextLine());
String stringS = sc.nextLine();
if (stringS.length() > maxLength) {
String output = stringS.substring(0, maxLength - ... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Integer maxLength = Integer.parseInt(sc.nextLine());
String stringS = sc.nextLine();
if (stringS.length() > maxLength) {
String output = stringS.substring(0, maxLength);
... | [["-", 49, 200, 51, 492, 3, 4, 0, 16, 17, 33], ["-", 49, 200, 51, 492, 3, 4, 0, 16, 12, 499]] | 3 | 109 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int k;
string s;
cin >> k >> s;
string ans;
if (s.size() <= k) {
ans = s;
} else {
ans = s.substr(0, s.size()) + "...";
}
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int k;
string s;
cin >> k >> s;
string ans;
if (s.size() <= k) {
ans = s;
} else {
ans = s.substr(0, k) + "...";
}
cout << ans << endl;
return 0;
} | [["-", 31, 2, 3, 4, 0, 2, 63, 118, 28, 22], ["-", 31, 2, 3, 4, 0, 2, 63, 118, 17, 131], ["-", 31, 2, 3, 4, 0, 2, 63, 118, 119, 120], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 24], ["-", 31, 2, 3, 4, 0, 2, 3, 4, 0, 25], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 22]] | 1 | 80 |
#include <bits/stdc++.h>
#define ROOP(i, N) for (int i = 0; i++; i < N)
#define RVROOP(i, N) for (int i = N; i--; i >= 0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
const double PI = acos(-1);
using namespace std;
typedef long long ll;
typedef unsigned lon... | #include <bits/stdc++.h>
#define ROOP(i, N) for (int i = 0; i++; i < N)
#define RVROOP(i, N) for (int i = N; i--; i >= 0)
#define ALL(v) v.begin(), v.end()
const int INF = 1e9;
const int MAX = 510000;
const int MOD = 1000000007;
const double PI = acos(-1);
using namespace std;
typedef long long ll;
typedef unsigned lon... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 72], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]] | 1 | 132 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String s = scan.next();
if (s.length() == n)
System.out.println(s);
else {
System.out.println(s.substring(0, n) + ""
... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
String s = scan.next();
// System.out.println(s.length());
if (s.length() <= n)
System.out.println(s);
else {
System.out.println(s... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 60], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 98 |
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[:k]+"..."
print(s) | [["-", 0, 1, 0, 662, 12, 657, 31, 206, 206, 612], ["-", 0, 1, 0, 662, 12, 657, 31, 206, 0, 21], ["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 102]] | 5 | 37 |
k = int(input())
s = input()
if len(s) > k:
s = s[k] + "..."
print(s)
| k = int(input())
s = input()
if len(s) > k:
s = s[:k] + "..."
print(s) | [["+", 0, 662, 12, 657, 31, 206, 206, 663, 0, 102]] | 5 | 35 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
string temp = "";
int l = s.length();
if (l == k)
cout << s;
else {
for (int i = 0; i < k; i++) {
temp += s[i];
}
temp += "...";
cout << temp;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
string temp = "";
int l = s.length();
if (l <= k)
cout << s;
else {
for (int i = 0; i < k; i++) {
temp += s[i];
}
temp += "...";
cout << temp;
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 90 |
k = int(input())
s = str(input())
if k > len(s):
print(s[:k]+'...')
else:
print(s) | k = int(input())
s = str(input())
if k < len(s):
print(s[:k]+'...')
else:
print(s) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18]] | 5 | 42 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int s;
cin >> s;
string n;
cin >> n;
if (size(n) <= s)
cout << n;
else
for (int i = 0; i < s; i++)
cout << n.at(i);
cout << "..." << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int s;
cin >> s;
string n;
cin >> n;
if (size(n) <= s)
cout << n;
else {
for (int i = 0; i < s; i++)
cout << n.at(i);
cout << "..." << endl;
}
} | [["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 71 |
k = gets.to_i
s = gets.to_s
length = s.size
if length <= k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | k = gets.to_i
s = gets.to_s
length = s.size
if length-1 <= k
puts s
else
newstr = s[0,k]
puts "#{newstr}..."
end | [["+", 0, 493, 0, 121, 15, 738, 31, 738, 17, 33], ["+", 0, 493, 0, 121, 15, 738, 31, 738, 12, 612]] | 4 | 38 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
int n;
n = S.size();
if (n <= K)
cout << S << endl;
else {
S.erase(K + 1);
cout << S << "..." << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
int n;
n = S.size();
if (n <= K)
cout << S << endl;
else {
S.erase(K);
cout << S << "..." << endl;
}
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 69 |
/*
ID: rchalam1
LANG: C++11
TASK:
*/
// For train.usaco.org, fill the template above.
// Competitive Coding Template
// GCC OPTIMIAZTION FLAGS
#ifndef LOCAL
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC targe... | /*
ID: rchalam1
LANG: C++11
TASK:
*/
// For train.usaco.org, fill the template above.
// Competitive Coding Template
// GCC OPTIMIAZTION FLAGS
#ifndef LOCAL
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline")
#pragma GCC option("arch=native", "tune=native", "no-zero-upper")
#pragma GCC targe... | [["-", 3, 4, 0, 16, 31, 2, 3, 4, 0, 13], ["+", 3, 4, 0, 16, 31, 2, 3, 4, 0, 22]] | 1 | 2,222 |
k = int(input())
s = input()
if k > len(s):
print(s)
else:
print(f"{s[:k]}...") | k = int(input())
s = input()
if k >= len(s):
print(s)
else:
print(f"{s[:k]}...") | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 40 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | [["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 3,855 |
k = int(input())
s = input()
if len(s) < k:
print(s)
else:
print(str(s[0:k]) + "...") | k = int(input())
s = input()
if len(s) <= k:
print(s)
else:
print(str(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 <stdio.h>
#include <string.h>
int main(void) {
char S[101];
int K, a, i;
scanf("%d", &K);
scanf("%s", S);
a = strlen(S);
if (a <= K) {
printf("%s\n", &S);
} else {
for (i = K + 1; i <= a; i++) {
S[i] = '\0';
}
for (i = K + 1; i <= K + 3; i++) {
S[i] = '.';
}
pr... | #include <stdio.h>
#include <string.h>
int main(void) {
char S[101];
int K, a, i;
scanf("%d", &K);
scanf("%s", S);
a = strlen(S);
if (a <= K) {
printf("%s\n", &S);
} else {
for (i = K; i <= a; i++) {
S[i] = '\0';
}
for (i = K; i <= K + 2; i++) {
S[i] = '.';
}
printf("%s... | [["-", 0, 9, 0, 7, 10, 11, 12, 16, 17, 72], ["-", 0, 9, 0, 7, 10, 11, 12, 16, 12, 13], ["-", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 0 | 140 |
k = int(input())
s = input()
if len(s) <= k:
print(s)
else:
print("{}...".format(s[:-(k + 1)])) | k = int(input())
s = input()
if len(s) <= k:
print(s)
else:
print("{}...".format(s[:k])) | [["-", 3, 4, 0, 206, 206, 663, 0, 664, 17, 33], ["-", 0, 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], ["-", 0, 206, 206, 663, 0, 664, 28, 23, 0, 25]] | 5 | 47 |
K = int(input())
S = input()
if len(S) <= K:
print(s)
else:
s = ""
for i in range(K):
s += S[i]
s += "..."
print(s) | K = int(input())
S = input()
if len(S) <= K:
print(S)
else:
s = ""
for i in range(K):
s += S[i]
s += "..."
print(s) | [["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 54 |
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys
INF = float('inf')
def solve(K: int, S: str):
return S[:K] + ['...', ''][len(S) < K]
def main():
sys.setrecursionlimit(10 ** 6)
def iterate_tokens():
... | #!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import itertools
import math
import sys
INF = float('inf')
def solve(K: int, S: str):
return S[:K] + ['...', ''][len(S) <= K]
def main():
sys.setrecursionlimit(10 ** 6)
def iterate_tokens():
... | [["-", 0, 37, 0, 657, 12, 206, 206, 666, 667, 18], ["+", 0, 37, 0, 657, 12, 206, 206, 666, 667, 19]] | 5 | 132 |
k = gets.to_i
s = gets
if s.length <= k
puts s
else
puts s[0..k-1] + '...'
end | k = gets.to_i
s = gets.chomp
if s.length <= 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 | 31 |
#include <iostream>
using namespace std;
int main() {
int K;
string S;
cin >> K;
cin >> 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>
using namespace std;
int main() {
int K;
string S;
cin >> K;
cin >> S;
if (int(S.length()) <= K) {
cout << S << endl;
} else {
for (int i = 0; i < K; i++) {
cout << S[i];
}
cout << "..." << endl;
}
return 0;
}
| [["+", 0, 57, 15, 339, 51, 16, 31, 2, 63, 40], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 24], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 15, 339, 51, 16, 31, 2, 3, 4, 0, 25], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 81 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
string b;
string c = "";
cin >> a;
cin >> b;
if (a == b.size()) {
cout << b;
return 0;
}
for (int i = 0; i < a; i++) {
c = c + b[i];
}
cout << c;
cout << "...";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
string b;
string c = "";
cin >> a;
cin >> b;
if (a >= b.size()) {
cout << b;
return 0;
}
for (int i = 0; i < a; i++) {
c = c + b[i];
}
cout << c;
cout << "...";
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 89 |
k=int(input())
s=input()
print(s[:k+1]+"{0}".format("..."*(len(s)>k))) | k=int(input())
s=input()
print(s[:k]+"{0}".format("..."*(len(s)>k))) | [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 43 |
k = gets.to_i
s = gets
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | k = gets.chomp.to_i
s = gets.chomp
if s.length <= k
puts s
else
puts "#{s[0...k]}..."
end | [["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 30 |
#include <stdio.h>
int main() {
int k;
scanf("%d", &k);
char s[100];
scanf("%s", s);
int s_len;
for (s_len = 0; s[s_len] != 0; s_len++)
;
if (s_len > k) {
printf("%s\n", s);
} else {
for (int i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...");
}
return 0;
}
| #include <stdio.h>
int main() {
int k;
scanf("%d", &k);
char s[100];
scanf("%s", s);
int s_len;
for (s_len = 0; s[s_len] != 0; s_len++)
;
if (s_len <= k) {
printf("%s\n", s);
} else {
for (int i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...\n");
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 115 |
#include <stdio.h>
int main(void) {
int k, i;
char s[101];
scanf("%d %s", &k, s);
for (i = 0; i < k && s[i] != '\0'; i++) {
printf("%s", s[i]);
}
if (s[i] != '\0') {
printf("...");
}
}
| #include <stdio.h>
int main(void) {
int k, i;
char s[101];
scanf("%d %s", &k, s);
for (i = 0; i < k && s[i] != '\0'; i++) {
printf("%c", s[i]);
}
if (s[i] != '\0') {
printf("...");
}
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 0 | 88 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
if (n <= s.length())
cout << s;
else {
for (int i = 0; i < n; i++)
cout << s[i];
cout << "...";
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string s;
cin >> n;
cin >> s;
if (n >= (int)s.length())
cout << s;
else {
for (int i = 0; i < n; i++)
cout << s[i];
cout << "...";
}
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 24], ["+", 15, 339, 51, 16, 12, 74, 39, 77, 39, 40], ["+", 0, 57, 15, 339, 51, 16, 12, 74, 0, 25]] | 1 | 70 |
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 (K >= S.length()) {
for (int i = 0; i < K; i++) {
System.out.print(S.charAt(i));
}
System.out.println("...");
... | 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 (K < S.length()) {
for (int i = 0; i < K; i++) {
System.out.print(S.charAt(i));
}
System.out.println("...");
... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18]] | 3 | 118 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int K;
int i = 0;
cin >> K >> s;
while (s[i]) {
i++;
}
if (i > K) {
for (int d = 0; d < i; d++) {
cout << s[i];
}
cout << "...";
} else {
cout << s;
}
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int K;
int i = 0;
cin >> K >> s;
while (s[i]) {
i++;
}
if (i > K) {
for (int d = 0; d < K; d++) {
cout << s[d];
}
cout << "...";
} else {
cout << s;
}
}
| [["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["-", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22], ["+", 0, 1, 0, 16, 12, 69, 341, 342, 0, 22]] | 1 | 87 |
K = int(input())
S = input()
word = S
if len(S) >= K:
word = S[:K] + "..."
print(word) | K = int(input())
S = input()
word = S
if len(S) > K:
word = S[:K] + "..."
print(word) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]] | 5 | 39 |
K=int(input())
S=input()
if len(S)<=K:
print(S)
else:
print(S[K]+"...") | K=int(input())
S=input()
if len(S)<=K:
print(S)
else:
print(S[0:K]+"...") | [["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["+", 3, 4, 0, 657, 31, 206, 206, 663, 0, 102]] | 5 | 38 |
K = int(input())
S = input()
n = len(S)
if n <= K:
print(S)
else:
print(S[0:K+1] + '...')
| K = int(input())
S = input()
n = len(S)
if n <= K:
print(S)
else:
print(S[0:K] + '...')
| [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 45 |
#include <stdio.h>
#include <string.h>
using namespace std;
typedef long long llong;
#define MAX 110
const llong mod = 1000000000 + 7;
int main() {
int k;
char s[MAX];
scanf("%d", &k);
scanf("%s", s);
int len = strlen(s);
for (int i = 0; i < len; i++) {
if (i >= k) {
printf(".");
}
pr... | #include <stdio.h>
#include <string.h>
using namespace std;
typedef long long llong;
#define MAX 110
const llong mod = 1000000000 + 7;
int main() {
int k;
char s[MAX];
scanf("%d", &k);
scanf("%s", s);
int len = strlen(s);
for (int i = 0; i < len; i++) {
if (i >= k) {
printf("...");
brea... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]] | 1 | 112 |
package main
import (
"fmt"
)
func main() {
var k int
var s string
fmt.Scan(&k, &s)
if k < len(s) {
fmt.Print(s[:k])
fmt.Println(",,,")
} else {
fmt.Println(s)
}
}
| package main
import (
"fmt"
)
func main() {
var k int
var s string
fmt.Scan(&k, &s)
if k < len(s) {
fmt.Print(s[:k])
fmt.Println("...")
} else {
fmt.Println(s)
}
}
| [] | 7 | 77 |
#include <stdio.h>
#include <string.h>
int main() {
char k[100];
int s;
char t[100];
scanf("%d", &s);
scanf("%s", k);
if (strlen(k) < s) {
printf("%s", k);
} else {
strncpy(t, k, s);
t[s] = '\0';
printf("%s...", t);
}
return 0;
}
| #include <stdio.h>
#include <string.h>
int main() {
char k[100];
int s;
char t[100];
scanf("%d", &s);
scanf("%s", k);
if (strlen(k) <= s) {
printf("%s", k);
} else {
strncpy(t, k, s);
t[s] = '\0';
printf("%s...", t);
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19]] | 0 | 97 |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second
#define debug(x) cout << x << endl;
#define repi(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n)
#define lp(i, n) repi(i, 0, n)
#def... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second
#define debug(x) cout << x << endl;
#define repi(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) repi(i, 0, n)
#define lp(i, n) repi(i, 0, n)
#def... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 0, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 0, 57, 75, 76, 0, 9, 0, 1, 0, 35], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["+", 0, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 167 |
def TripleDots():
Num = int(input())
moji = str(input())
if len(moji) >= Num:
moji_cut = moji[:Num] + '...'
else:
moji_cut = moji
print(moji_cut)
if __name__ == '__main__':
TripleDots()
| def TripleDots():
Num = int(input())
moji = str(input())
if len(moji) > Num:
moji_cut = moji[:Num] + '...'
else:
moji_cut = moji
print(moji_cut)
if __name__ == '__main__':
TripleDots()
| [["-", 0, 14, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 667, 47]] | 5 | 59 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int k, i;
cin >> k;
cin >> s;
if (s.length() <= k)
cout << s << endl;
else {
for (i = 0; i < 7; i++) {
cout << s[i];
}
cout << "..." << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int k, i;
cin >> k;
cin >> s;
if (s.length() <= k)
cout << s << endl;
else {
for (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 | 77 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
string S;
cin >> S;
string A;
int size = S.size();
if (size < K) {
cout << S << endl;
} else {
for (int i = 0; i < K; i++) {
A += S.at(i);
}
cout << A << "..." << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
string S;
cin >> S;
string A;
int size = S.size();
if (size <= K) {
cout << S << endl;
} else {
for (int i = 0; i < K; i++) {
A += S.at(i);
}
cout << A << "..." << endl;
}
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 90 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
string str;
cin >> str;
if (str.size() >= N) {
for (int i = 0; i < N; i++) {
cout << str.at(i);
}
cout << "..." << endl;
} else {
for (int i = 0; i < str.size(); i++) {
cout << str.at(i);
}
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
string str;
cin >> str;
if (str.size() > N) {
for (int i = 0; i < N; i++) {
cout << str.at(i);
}
cout << "..." << endl;
} else {
for (int i = 0; i < str.size(); i++) {
cout << str.at(i);
}
}
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 103 |
k = int(input())
s = input()
if len(s) <= k:
print(s)
elif len(s) > k:
print(s[:k - 1] + '...') | k = int(input())
s = input()
if len(s) <= k:
print(s)
elif len(s) > k:
print(s[: k] + '...') | [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 47 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
String str = sc.nextLine();
if (str.length() <= A) {
System.out.println(str);
} else {
String s = str.substring(0, A);
s = s + "...";
... | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
String str = sc.next();
if (str.length() <= A) {
System.out.println(str);
} else {
String s = str.substring(0, A);
s = s + "...";
Syst... | [["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22]] | 3 | 106 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int a;
string b;
cin >> a >> b;
int c = b.size();
if (a < c) {
for (int i = 0; i < c; i++) {
cout << b[i];
}
cout << "...";
} else {
cout << b;
}
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
int a;
string b;
cin >> a >> b;
int c = b.size();
if (a < c) {
for (int i = 0; i < a; i++) {
cout << b[i];
}
cout << "...";
} else {
cout << b;
}
} | [["-", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 12, 22]] | 1 | 79 |
K = int(input())
S = input()
ans = ""
if K >= len(S):
print(S)
else:
for i in range(K):
ans += S[i]
print(ans + "…") | K = int(input())
S = input()
ans = ""
if K >= len(S):
print(S)
else:
for i in range(K):
ans += S[i]
print(ans + "...") | [["-", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 657, 12, 557, 0, 6]] | 5 | 53 |
k = int(input())
s = str(input())
if len(s) <= k:
print(s)
elif len(s) > k:
print(s[0:k-1] + '...') | k = int(input())
s = str(input())
if len(s) <= k:
print(s)
elif len(s) > k:
print(s[:k] + '...') | [["-", 3, 4, 0, 657, 31, 206, 206, 663, 0, 612], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 51 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (k > s.length())
return cout << s << endl, 0;
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (k >= s.length())
return cout << s << endl, 0;
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 | 77 |
#https://atcoder.jp/contests/abc168
k=gets.to_i
s=gets
if s.length<=k
print s
else
print s[0..k-1],"..."
end
| #https://atcoder.jp/contests/abc168
k=gets.to_i
s=gets
if s.length-1<=k#lengthに改行が含まれてる
print s
else
print s[0..k-1],"..."
end
| [["+", 0, 493, 0, 121, 15, 738, 31, 738, 17, 33], ["+", 0, 493, 0, 121, 15, 738, 31, 738, 12, 612]] | 4 | 32 |
// 69
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int k;
string str;
cin >> k >> str;
for (int i = 0; i < str.length(); i++) {
... | // 69
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
int k;
string str;
cin >> k >> str;
for (int i = 0; i < str.length(); i++) {
... | [["-", 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 | 96 |
K = int(input())
S = input()
if len(S) <= K:
print(S)
elif len(S) > K:
print(S[0:K-1]+"...") | K = int(input())
S = input()
if len(S) <= K:
print(S)
elif len(S) > K:
print(S[0:K]+"...") | [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 48 |
K = int(input())
S = input()
if len(S) < K:
print(S)
else:
print("{0}...".format(S[0:K])) | K = int(input())
S = input()
if len(S) <= K:
print(S)
else:
print("{0}...".format(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 |
def Ii():return int(input())
def Mi():return map(int,input().split())
def Li():return list(map(int,input().split()))
k = Ii()
a = input()
m = len(a)
if k > m:
print(a)
else:
print(a[:k],end="")
print('...') | def Ii():return int(input())
def Mi():return map(int,input().split())
def Li():return list(map(int,input().split()))
k = Ii()
a = input()
m = len(a)
if k >= m:
print(a)
else:
print(a[:k],end="")
print('...') | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 97 |
// Never stop chasing!-MdSourav.
#include <bits/stdc++.h>
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define sz(x) x.size()
#define ll long long int
#define ls long int
#define start \
ios_base::sync_with_stdio(0); ... | // Never stop chasing!-MdSourav.
#include <bits/stdc++.h>
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define sz(x) x.size()
#define ll long long int
#define ls long int
#define start \
ios_base::sync_with_stdio(0); ... | [["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 329 |
#include <stdio.h>
#include <string.h>
int main() {
int k, i, len;
char s[101];
scanf("%d %s", &k, s);
len = strlen(s);
if (len >= k) {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...\n");
} else
printf("%s", s);
return 0;
} | #include <stdio.h>
#include <string.h>
int main() {
int k, i, len;
char s[101];
scanf("%d %s", &k, s);
len = strlen(s);
if (len > k) {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...\n");
} else
printf("%s", s);
return 0;
} | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47]] | 0 | 98 |
<?php
$k = fgets(STDIN);
$s = str_split(fgets(STDIN));
if (count($s) <= $k) {
echo trim(implode($s));
} else {
$arr = [];
$arr = array_slice($s, 0, $k);
array_push($arr, "...");
echo trim(implode($arr));
} | <?php
$k = trim(fgets(STDIN));
$s = str_split(trim(fgets(STDIN)));
if (count($s) <= $k) {
echo trim(implode($s));
} else {
$arr = [];
$arr = array_slice($s, 0, $k);
array_push($arr, "...");
echo trim(implode($arr));
} | [["+", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["+", 3, 3, 0, 28, 0, 613, 3, 3, 0, 25], ["+", 12, 613, 3, 3, 0, 28, 0, 613, 63, 141]] | 6 | 86 |
#include <bits/stdc++.h>
using namespace std;
long N;
string S;
int main(void) {
cin >> N;
cin >> S;
if (N > S.length()) {
cout << S << endl;
} else {
cout << S.substr(0, N) << "..." << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
long N;
string S;
int main(void) {
cin >> N;
cin >> S;
if (N >= S.length()) {
cout << S << endl;
} else {
cout << S.substr(0, N) << "..." << endl;
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 68 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
/* vector<int>v;
vector<int>v1;
vector<int>v2;
set <char>s;
int t,coun1=0,a,ans3,coun2=0,x,y=0,ans1=0,b,sum=0,flag=0,ans2;*/
long long ai, t, n, a, b, c = 0;
string str;
string str1;
cin >> n;
getchar();
getline... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
/* vector<int>v;
vector<int>v1;
vector<int>v2;
set <char>s;
int t,coun1=0,a,ans3,coun2=0,x,y=0,ans1=0,b,sum=0,flag=0,ans2;*/
long long ai, t, n, a, b, c = 0;
string str;
string str1;
cin >> n;
getchar();
getline... | [["-", 0, 11, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 11, 12, 16, 31, 2, 3, 4, 0, 22]] | 1 | 102 |
#include <stdio.h>
#include <string.h>
int main(void) {
char s[101];
int k, len, i;
scanf("%d %c", &k, s);
len = strlen(s);
if (len <= k) {
printf("%s\n", s);
} else {
for (i = 0; i < k; i++) {
printf("%c", s[i]);
}
printf("...\n");
}
return 0;
} | #include <stdio.h>
#include <string.h>
int main(void) {
char s[101];
int k, len, i;
scanf("%d %s", &k, s);
len = strlen(s);
if (len <= k) {
printf("%s\n", s);
} else {
for (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]] | 0 | 102 |
K = gets.to_i
s = gets
if s.length > K then
s = s[0..K-1] + "..."
end
puts s | K = gets.to_i
s = gets.chomp
if s.length > K then
s = s[0..K-1] + "..."
end
puts s | [["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 32 |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
static class FastReader {
BufferedReader br;
StringTokenizer... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 464 |
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.nextLine();
String tmp;
if (S.length() > K) {
tmp = S.substring(K);
tmp = tmp + "...";
} else {
tmp = S;
}
System... | 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();
String tmp;
if (S.length() > K) {
tmp = S.substring(0, K);
tmp = tmp + "...";
} else {
tmp = S;
}
System.... | [["-", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 8, 196, 0, 503, 49, 200, 51, 492, 141, 22], ["+", 0, 1, 0, 11, 12, 492, 3, 4, 0, 499], ["+", 0, 1, 0, 11, 12, 492, 3, 4, 0, 21]] | 3 | 101 |
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
/*bool compare_function(const pair<int, int> a, const pair<int, int> b)
{
return a.first ... | #include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
/*bool compare_function(const pair<int, int> a, const pair<int, int> b)
{
return a.first ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 158 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.