buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memse... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 166 |
k = gets.to_i
s = gets
num = s.length
puts num <= k ? s : "#{s[0..k-1]}..." | k = gets.to_i
s = gets.strip
num = s.length
puts num <= k ? s : "#{s[0..k-1]}..." | [["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 33 |
num=int(input())
str=input()
if(len(str)<=num):
print(str)
else:
print(str[0:num],"...") | num=int(input())
str=input()
if(len(str)<=num):
print(str)
else:
print(str[0:num]+"...") | [["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72]] | 5 | 42 |
#include <iostream>
#include <math.h>
using namespace std;
using ll = long long;
int main() {
int k;
string s;
cin >> k;
cin >> s;
string snew = "";
for (int i = 0; i < s.length(); i++) {
if (i == 7) {
snew += "...";
break;
} else
snew += s[i];
}
cout << snew << endl;
} | #include <iostream>
#include <math.h>
#include <string>
using namespace std;
using ll = long long;
int main() {
int k;
string s;
cin >> k;
cin >> s;
string snew = "";
for (int i = 0; i < s.length(); i++) {
if (i == k) {
snew += "...";
break;
} else
snew += s[i];
}
cout << snew... | [["+", 36, 36, 36, 36, 0, 30, 0, 135, 0, 138], ["+", 36, 36, 36, 36, 0, 30, 0, 135, 136, 137], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 90 |
//#include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | //#include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;
typedef long long... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 337 |
S=int(input())
K=input()
k=len(K)
if k>=S:
print(K[:S]+'...')
else:
print(K) | S=int(input())
K=input()
k=len(K)
if k>S:
print(K[:S]+'...')
else:
print(K) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]] | 5 | 42 |
K = int(input())
S = input()
answer = None
is_less_than_K = len(S) <= K
if is_less_than_K:
answer = S
else:
answer = S[0:K + 1] + '...'
print(answer)
| K = int(input())
S = input()
answer = None
is_less_than_K = len(S) <= K
if is_less_than_K:
answer = S
else:
answer = S[0:K] + '...'
print(answer)
| [["-", 12, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 12, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 50 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll gcd(ll a, ll b) {
if ... | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define dec(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll gcd(ll a, ll b) {
if ... | [["+", 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 | 186 |
/*Made by Shivam Solanki*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define ll long long int
#define endl '\n'
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ... | /*Made by Shivam Solanki*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define ll long long int
#define endl '\n'
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 313 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <utility>
#include <vector>
#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 argc, const char *argv[]) {
int k;
str... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <utility>
#include <vector>
#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 argc, const char *argv[]) {
int k;
str... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 112 |
k=int(input())
s=list(input())
if len(s)<=k:
print(s)
else:
s=s[0:k]+["..."]
print(*s,sep="") | k=int(input())
s=list(input())
if len(s)<=k:
print(*s,sep="")
else:
s=s[0:k]+["..."]
print(*s,sep="") | [["+", 0, 1, 0, 652, 3, 4, 0, 661, 0, 48], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 141, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 653, 0, 32], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 654], ["+", 0, 652, 3, 4, 0, 653, 51, 557, 0, 655]] | 5 | 54 |
#include <iostream>
#include <string>
int main() {
int K;
std::string S;
std::cin >> K >> S;
if (K > S.size()) {
for (int i = 0; i < K; ++i) {
std::cout << S.at(i);
}
std::cout << "...\n";
} else {
std::cout << S << "\n";
}
return 0;
} | #include <iostream>
#include <string>
int main() {
int K;
std::string S;
std::cin >> K >> S;
if (K < S.size()) {
for (int i = 0; i < K; ++i) {
std::cout << S.at(i);
}
std::cout << "...\n";
} else {
std::cout << S << "\n";
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 90 |
S=input()
K=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[:K]+"...") | [["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 36 |
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();
int s = S.length();
if (s <= K) {
System.out.println(S);
} else {
String T = S.substring(K);
System.out.println(T ... | 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();
int s = S.length();
if (s <= K) {
System.out.println(S);
} else {
String T = S.substring(0, K);
System.out.println... | [["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 499], ["+", 0, 503, 49, 200, 51, 492, 3, 4, 0, 21]] | 3 | 105 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
String str = sc.next();
if (num <= str.length()) {
str = str.substring(0, num);
System.out.printf(str + "...");
} else {
System.out... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
String str = sc.next();
if (num < str.length()) {
str = str.substring(0, num);
System.out.printf(str + "...");
} else {
System.out.... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18]] | 3 | 101 |
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, s, e) for (int i = s; i < e; i++)
#define endl '\n'
int main() {
int K;
string S;
cin >> K >> S;
int len = S.size();
if (len <= K) {
cout << S << endl;
} else {
rep(i, 0, len) { cout << S[i]; }
cout << "..." <... | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i, s, e) for (int i = s; i < e; i++)
#define endl '\n'
int main() {
int K;
string S;
cin >> K >> S;
int len = S.size();
if (len <= K) {
cout << S << endl;
} else {
rep(i, 0, K) { cout << S[i]; }
cout << "..." << ... | [["-", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 92 |
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | #include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
... | [["-", 12, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 12, 2, 3, 4, 0, 16, 31, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 535 |
#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, t;
string s;
cin >> k >> s;
t = s.size();
if (t > k) {
cout << s.substr(0, k) << " ..."
<< "\n";
return 0;
} else {
cout << ... | #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, t;
string s;
cin >> k >> s;
t = s.size();
if (t > k) {
cout << s.substr(0, k) << "..."
<< "\n";
return 0;
} else {
cout << s... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 102 |
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner ob = new Scanner(System.in);
int K = ob.nextInt();
String S = ob.next();
String D = "...";
String R = "";
if (S.length() > K) {
for (int i = 0; i < 7; i++) {
R += S.charAt(i);
}
... | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner ob = new Scanner(System.in);
int K = ob.nextInt();
String S = ob.next();
String D = "...";
String R = "";
if (S.length() > K) {
for (int i = 0; i < K; i++) {
R += S.charAt(i);
}
... | [["-", 0, 57, 64, 196, 0, 7, 15, 16, 12, 499], ["+", 0, 57, 64, 196, 0, 7, 15, 16, 12, 22]] | 3 | 130 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, i;
char c[250];
scanf("%d", &k);
scanf("%s", c);
n = strlen(c);
if (k >= n) {
for (i = 0; i < n; i++) {
printf("%c", c[i]);
}
} else {
for (i = 0; i < k; i++) {
printf("%c", c[i]);
printf("...");
}
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, i;
char c[250];
scanf("%d", &k);
scanf("%s", c);
n = strlen(c);
if (k >= n) {
for (i = 0; i < n; i++) {
printf("%c", c[i]);
}
} else {
for (i = 0; i < k; i++) {
printf("%c", c[i]);
}
printf("...");
}
r... | [["+", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46], ["-", 75, 76, 0, 9, 0, 7, 8, 9, 0, 46]] | 1 | 126 |
#include <bits/stdc++.h>
#define ll long long
#define fl(i, n) for (i = 0; i < n; i++)
#define fld(i, a, b) for (i = a; i > b; i--)
#define fli(i, a, n) for (i = a; i < n; i++)
#define inp(i, a, n) \
for (i = 0; i < n; i++) { ... | #include <bits/stdc++.h>
#define ll long long
#define fl(i, n) for (i = 0; i < n; i++)
#define fld(i, a, b) for (i = a; i > b; i--)
#define fli(i, a, n) for (i = a; i < n; i++)
#define inp(i, a, n) \
for (i = 0; i < n; i++) { ... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 192 |
k=int(input())
s=input()
if(k>len(s)):
print(s)
else:
print(s[0:k]+'...')
| k=int(input())
s=input()
if(k>=len(s)):
print(s)
else:
print(s[0:k]+'...')
| [["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20]] | 5 | 42 |
def main():
import sys
length = int(sys.stdin.readline())
string = sys.stdin.readline()
if(len(string) <= length):
print(string)
else:
print(string[:length] + "...")
if __name__ == "__main__":
main() | def main():
import sys
length = int(sys.stdin.readline())
string = sys.stdin.readline().strip()
if(len(string) <= length):
print(string)
else:
print(string[:length] + "...")
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 | 66 |
#include <stdio.h>
int main() {
int n, count = 0;
char str[1000];
scanf("%d", &n);
scanf("%s", str);
for (int i = 0; str[i] != '\0'; i++)
count++;
if (count < n)
puts(str);
else {
for (int i = 0; i < n; i++)
printf("%c", str[i]);
printf("...");
}
return 0;
} | #include <stdio.h>
int main() {
int n, count = 0;
char str[1000];
scanf("%d", &n);
scanf("%s", str);
for (int i = 0; str[i] != '\0'; i++)
count++;
if (count <= n)
puts(str);
else {
for (int i = 0; i < n; i++)
printf("%c", str[i]);
printf("...\n");
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 19], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 112 |
#include <iostream>
using namespace std;
int main() {
string s, news;
long unsigned int k;
cin >> k >> s;
if (s.size() <= k) {
cout << s;
return 0;
} else {
s.erase(k - 1, s.size() - 1);
s.append("...");
cout << s;
return 0;
}
} | #include <iostream>
using namespace std;
int main() {
string s, news;
long unsigned int k;
cin >> k >> s;
if (s.size() <= k) {
cout << s;
return 0;
} else {
s.erase(k, s.size() - 1);
s.append("...");
cout << s;
return 0;
}
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]] | 1 | 83 |
K = int(input())
S = input()
s = ""
for x in range(min(len(S),K)):
s += S[x]
if len(S) >= K:
print(s + "...")
else:
print(s)
| K = int(input())
S = input()
s = ""
for x in range(min(len(S),K)):
s += S[x]
if len(S) > 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 | 61 |
k = gets.to_i
s = gets
if k < s.length then
puts s[0..k-1] + "..."
else
puts s
end
| k = gets.to_i
s = gets.chomp
if k < s.length then
puts s[0..k-1] + "..."
else
puts s
end
| [["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]] | 4 | 32 |
#include <bits/stdc++.h>
using namespace std;
//#define int long long
typedef vector<int> Vl;
typedef vector<vector<int>> Vn;
typedef pair<int, int> pii;
typedef vector<pii> Vll;
typedef vector<pair<int, pair<int, int>>> Vlll;
#define S second
#define F first
#define mp make_pair
#define ms(x, y) memset(x, y, sizeof(x)... | #include <bits/stdc++.h>
using namespace std;
//#define int long long
typedef vector<int> Vl;
typedef vector<vector<int>> Vn;
typedef pair<int, int> pii;
typedef vector<pii> Vll;
typedef vector<pair<int, pair<int, int>>> Vlll;
#define S second
#define F first
#define mp make_pair
#define ms(x, y) memset(x, y, sizeof(x)... | [["-", 0, 7, 15, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 7, 15, 16, 12, 16, 31, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 231 |
#include <stdio.h>
#include <string.h>
int main() {
int K;
scanf("%d", &K);
char S[100];
scanf("%s", S);
if (strlen(S) <= K) {
printf("%s", S);
} else {
for (int i = 0; i <= K; i++) {
printf("%c", S[i]);
}
printf("...");
}
}
| #include <stdio.h>
#include <string.h>
int main() {
int K;
scanf("%d", &K);
char S[100];
scanf("%s", S);
if (strlen(S) <= K) {
printf("%s", S);
} else {
for (int i = 0; i < K; i++) {
printf("%c", S[i]);
}
printf("...");
}
}
| [["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18]] | 0 | 96 |
k, s = int(input()), input()
print(s[::k] + "..." if len(s) > k else s) | k, s = int(input()), input()
print(s[:k] + "..." if len(s) > k else s) | [["-", 0, 41, 0, 657, 31, 206, 206, 663, 0, 102]] | 5 | 36 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int l = s.length();
if (l == n)
cout << s << endl;
else {
for (int i = 0; i < n; i++)
cout << s[i];
cout << "...\n";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s;
cin >> s;
int l = s.length();
if (l <= n)
cout << s << endl;
else {
for (int i = 0; i < n; i++)
cout << s[i];
cout << "...\n";
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 81 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
for (int i = 0; i < (k - 1); i++) {
cout << s[i];
}
cout << "..." << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
}
}
| [["-", 0, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["-", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 9, 0, 7, 15, 16, 12, 23, 0, 25]] | 1 | 80 |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) \
{ ... | #include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) \
{ ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 190 |
k = int(input())
s = input()
if k > s:
print(s[0:k+1] + "...")
else:
print(s)
| k = int(input())
s = input()
if k < len(s):
print(s[0:k] + "...")
else:
print(s) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 0, 656, 0, 57, 15, 666, 0, 652, 63, 22], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 24], ["+", 0, 57, 15, 666, 0, 652, 3, 4, 0, 25], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 72], ["-", 0, 657, 31, 206, 206, 663, 0, 65... | 5 | 39 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
const int int_inf = 100000000;
const double eps = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template <class T> inline bool chmax(T &a, T b) {
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 60;
const int int_inf = 100000000;
const double eps = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
template <class T> inline bool chmax(T &a, T b) {
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 223 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
cout << s.substr(0, k) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
cout << s.substr(0, k) << "..." << endl;
}
}
| [["+", 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 | 58 |
inputk = input()
k = int(inputk)
s = input()
#len()は文字数取得
if(len(s) <= k): print(s)
else: print(s[0 : k - 1] + "...")
| inputk = input()
k = int(inputk)
s = input()
#len()は文字数取得
if(len(s) <= k): print(s)
else: print(s[0 : k] + "...")
| [["-", 0, 657, 31, 206, 206, 663, 0, 657, 17, 33], ["-", 0, 657, 31, 206, 206, 663, 0, 657, 12, 612]] | 5 | 48 |
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size()
#define pb push_back
#define get(n) scanf("%d", &n);
#... | #include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <complex>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <utility>
#include <vector>
#define fir first
#define sec second
#define sz(s) (s).size()
#define pb push_back
#define get(n) scanf("%d", &n);
#... | [["-", 0, 9, 0, 1, 0, 11, 12, 103, 0, 104], ["-", 0, 9, 0, 1, 0, 11, 12, 103, 0, 125], ["-", 0, 1, 0, 11, 12, 103, 0, 42, 0, 131], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 62], ["+", 0, 9, 0, 1, 0, 11, 12, 5, 0, 6]] | 1 | 2,117 |
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (... | #include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (... | [["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 22]] | 1 | 182 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
#define F first
#define S second
#define sz(x) (int)x.size()
#define db(x) cerr << #x << ": " << x << "\n";
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
#define F first
#define S second
#define sz(x) (int)x.size()
#define db(x) cerr << #x << ": " << x << "\n";
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 113 |
#include <algorithm>
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const double pi = 3.141592653589793;
#define INF 1000000000000
signed main() {
int k;
string s;
cin >> k >> s;
if (s.size() > k) {
rep(i, 7) { cout << s[i]; ... | #include <algorithm>
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const double pi = 3.141592653589793;
#define INF 1000000000000
signed main() {
int k;
string s;
cin >> k >> s;
if (s.size() > k) {
rep(i, k) { cout << s[i]; ... | [["-", 64, 9, 0, 42, 0, 2, 3, 4, 0, 13], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]] | 1 | 89 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s, ans;
cin >> k >> s;
if (s.length() <= k) {
ans = s;
} else {
ans = s.substr(0, k);
}
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s, ans;
cin >> k >> s;
if (s.length() <= k) {
ans = s;
} else {
ans = s.substr(0, k) + "...";
}
cout << ans << endl;
return 0;
}
| [["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6]] | 1 | 65 |
/*
** Author: MAC45
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("input.txt", "rt", stdin);
// freopen("output.txt","wt",stdout);
ll S;
string K;
cin >> S >> K;
if (K.size() == S)
cout << K ... | /*
** Author: MAC45
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// freopen("input.txt", "rt", stdin);
// freopen("output.txt","wt",stdout);
ll S;
string K;
cin >> S >> K;
if (K.size() <= S)
cout << K ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 102 |
#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()
#define MOO(i, a, b) for (int i = a; i < b; i++)
#define M00(i, a) for (int i = 0; i < a; i++)
#define MOOd(i, a, b) for (int i = (b)-... | #include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define sz(v) (int)v.size()
#define MOO(i, a, b) for (int i = a; i < b; i++)
#define M00(i, a) for (int i = 0; i < a; i++)
#define MOOd(i, a, b) for (int i = (b)-... | [["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 222 |
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int k;
cin >> k;
string s;
cin >> s;
if (k > s.length()) {
cout << s << endl;
} else {
cout << s.substr(0, k) << "...";
}
} | #include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int k;
cin >> k;
string s;
cin >> s;
if (k >= s.length()) {
cout << s << endl;
} else {
cout << s.substr(0, k) << "...";
}
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 82 |
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
INF, NINF = float('inf'), float('-inf')
def main():
k = int(rl())
s = rll()[0]
print(s)
if len(s) > k:
... | from sys import stdin, stdout
from collections import deque, defaultdict
import math as m
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())
INF, NINF = float('inf'), float('-inf')
def main():
k = int(rl())
s = rll()[0]
if len(s) > k:
print("".j... | [["-", 0, 14, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 147 |
#include <bits/stdc++.h>
#define int long long int
#define boost ios_base::sync_with_stdio(false)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repp(i, a, b) for (int i = a; i <= b; i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define al... |
#include <bits/stdc++.h>
#define int long long int
#define boost ios_base::sync_with_stdio(false)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repp(i, a, b) for (int i = a; i <= b; i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
#define al... | [["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 178 |
#include <bits/stdc++.h>
using namespace std;
struct expand_type {
template <typename... T> expand_type(T &&...) {}
};
template <typename... ArgTypes> void print(ArgTypes... args) {
expand_type{0, (cerr << args << ", ", 0)...};
cerr << "\b\b \n";
}
#define printv(x) ... | #include <bits/stdc++.h>
using namespace std;
struct expand_type {
template <typename... T> expand_type(T &&...) {}
};
template <typename... ArgTypes> void print(ArgTypes... args) {
expand_type{0, (cerr << args << ", ", 0)...};
cerr << "\b\b \n";
}
#define printv(x) ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 187 |
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
String y = s.next();
if (n < y.length()) {
y += y.substring(0, n);
System.out.println(y);
} else
System.out.println(y);
}
}
| import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
String y = s.next();
if (n < y.length()) {
y = y.substring(0, n);
System.out.println(y + "...");
} else
System.out.println(y);
}
}
| [["-", 0, 57, 64, 196, 0, 1, 0, 11, 17, 107], ["+", 0, 57, 64, 196, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 72], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 62], ["+", 0, 492, 3, 4, 0, 16, 12, 5, 0, 491]] | 3 | 95 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < (int)n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (i... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i, a, n) for (int i = a; i < (int)n; i++)
#define rf(i, n, a) for (int i = n; i >= a; i--)
#define F first
#define S second
#define all(c) (c).begin(), (c).end()
#define sz(v) (i... | [["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 187 |
#include <bits/stdc++.h>
#define ll long long
#define sz(x) int(x.size())
using namespace std;
int main() {
ll x;
cin >> x;
string s;
cin >> s;
if (sz(s) < x)
cout << s << "\n";
else {
cout << s.substr(0, x) << "...\n";
}
} | #include <bits/stdc++.h>
#define ll long long
#define sz(x) int(x.size())
using namespace std;
int main() {
ll x;
cin >> x;
string s;
cin >> s;
if (sz(s) <= x)
cout << s << "\n";
else {
cout << s.substr(0, x) << "...\n";
}
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 71 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (k >= s.length())
cout << s << endl;
else {
s = s.substr(0, k);
cout << s << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (k >= s.length())
cout << s << endl;
else {
s = s.substr(0, k) + "...";
cout << s << endl;
}
return 0;
} | [["+", 0, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 62], ["+", 0, 1, 0, 11, 12, 16, 12, 5, 0, 6]] | 1 | 63 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr char newl = '\n';
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int K;
string s;
cin >> K >> s;
if (s.size() >= K)
s = s.substr(0, K) + "...";
cout << s << newl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr char newl = '\n';
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int K;
string s;
cin >> K >> s;
if (s.size() > K)
s = s.substr(0, K) + "...";
cout << s << newl;
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 86 |
k=int(input())
s=input()
if(len(s)<=k):
print(s)
else:
print(s[:k+1]+'...') | k=int(input())
s=input()
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 | 43 |
K = gets.to_i
S = gets.chomp
if S.length <= K then
p S
elsif S.length > K then
p S[0..(K-1)]+"..."
end
| K = gets.to_i
S = gets.chomp
if S.length <= K then
puts S
elsif S.length > K then
puts S[0..(K-1)]+"..."
end | [["-", 0, 493, 0, 121, 64, 749, 0, 652, 735, 22], ["+", 0, 493, 0, 121, 64, 749, 0, 652, 735, 22], ["-", 0, 121, 75, 759, 64, 749, 0, 652, 735, 22], ["+", 0, 121, 75, 759, 64, 749, 0, 652, 735, 22]] | 4 | 42 |
K = gets.to_i
S = gets.chomp
if S.size > K
puts "#{S[0..K-1]}..."
elsif S.size == K
puts S
end
| K = gets.to_i
S = gets.chomp
if S.size > K
puts "#{S[0..K-1]}..."
elsif S.size == K
puts S
else
puts S
end
| [["+", 0, 493, 0, 121, 75, 759, 75, 95, 0, 95], ["+", 0, 121, 75, 759, 75, 95, 0, 652, 735, 22], ["+", 75, 759, 75, 95, 0, 652, 3, 4, 0, 743]] | 4 | 39 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string S;
int L, K;
cin >> K;
cin >> S;
char ch;
L = S.length();
if (L <= K) {
cout << S << "";
} else {
for (int i = 0; i <= L; i++) {
ch = S.at(i);
cout << ch;
}
cout << "...";
}
return 0;
}
| #include <iostream>
#include <string>
using namespace std;
int main() {
string S;
int L, K;
cin >> K;
cin >> S;
char ch;
L = S.length();
if (L <= K) {
cout << S << "";
} else {
for (int i = 0; i <= (K - 1); i++) {
ch = S.at(i);
cout << ch;
}
cout << "...";
}
return 0;
} | [["-", 75, 76, 0, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 9, 0, 7, 15, 16, 12, 23, 0, 24], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 31, 22], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 17, 33], ["+", 0, 7, 15, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 9, 0, 7, 15, 16, 12, 23, 0, 25]] | 1 | 97 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
char a[101];
cin >> n;
cin.get();
cin >> a;
if (n < strlen(a)) {
a[7] = 0;
strcat(a, "...");
cout << a;
} else
cout << a;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
int n;
char a[150];
cin >> n;
cin.get();
cin >> a;
if (n < strlen(a)) {
a[n] = 0;
strcat(a, "...");
cout << a;
} else
cout << a;
}
| [["-", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 80, 81, 13], ["-", 0, 1, 0, 11, 31, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 74 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int main() {
int k;
string s;
cin >> k >> s;
if (k <= s.size()) {
for (int i = 0; i < s.size(); i++) {
if (i < k)
cout << s[i];
}
cout << "..." << endl;
} else {
cout << s << endl;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int main() {
int k;
string s;
cin >> k >> s;
if (k < s.size()) {
for (int i = 0; i < s.size(); i++) {
if (i < k)
cout << s[i];
}
cout << "..." << endl;
} else {
cout << s << endl;
}... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 97 |
K=int(input())
S=input()
def moji(S,K):
if len(S)<=K:
print(S)
else:
T=""
for i in range(len(S)):
if i <K:
T+=S[i]
if i >=K:
continue
T+="..."
print(T)
moji("S",K)
| K=int(input())
S=input()
def moji(S,K):
if len(S)<=K:
print(S)
else:
T=""
for i in range(len(S)):
if i <K:
T+=S[i]
if i >=K:
continue
T+="..."
print(T)
moji(S,K) | [["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]] | 5 | 84 |
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
int s = S.size();
if (s <= K) {
cout << S << endl;
} else {
string k;
for (int i = 0; i < K; i++) {
k += S.at(i);
}
cout << k << "…" << endl;
}
}
| #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
int s = S.size();
if (s <= K) {
cout << S << endl;
} else {
string k;
for (int i = 0; i < K; i++) {
k += S.at(i);
}
cout << k << "..." << endl;
}
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 90 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k;
cin >> s;
if (k > (int)s.size()) {
cout << s << endl;
return 0;
} else {
string sk;
sk = s.substr(0, k);
cout << sk << "..." << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k;
cin >> s;
if (k >= s.size()) {
cout << s << endl;
return 0;
} else {
string sk;
sk = s.substr(0, k);
cout << sk << "..." << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 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], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 80 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
if (k > s.length()) {
cout << s << endl;
} else {
for (int i = 0; i < k; i++)
cout << s.at(i);
cout << "..." << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
if (k >= s.length()) {
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, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 81 |
#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
typedef long long ll;
#define writeln(n) cout << n << "\n"
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> P;
typedef pair<string, int> Psi;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int k;
c... | #include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
typedef long long ll;
#define writeln(n) cout << n << "\n"
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> P;
typedef pair<string, int> Psi;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int k;
c... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 33], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 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 | 149 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, i;
string s, ans;
ans = "";
cin >> s;
n = s.size();
if (n <= k) {
cout << s;
return 0;
};
for (i = 0; i < k; i++) {
ans += s[i];
}
ans += "...";
cout << ans;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k, i;
cin >> k;
string s, ans;
ans = "";
cin >> s;
n = s.size();
if (n <= k) {
cout << s;
return 0;
};
for (i = 0; i < k; i++) {
ans += s[i];
}
ans += "...";
cout << ans;
return 0;
} | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 92 |
#include <iostream>
#include <string>
using namespace std;
int ABC_168_B() {
int k;
string s;
string s_r;
cin >> k;
cin >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
s_r = s.erase(7);
cout << s_r << "..." << endl;
}
return 0;
}
int main() {
ABC_168_B();
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int ABC_168_B() {
int k;
string s;
string s_r;
cin >> k;
cin >> s;
if (s.size() <= k) {
cout << s << endl;
} else {
s_r = s.erase(k);
cout << s_r << "..." << endl;
}
return 0;
}
int main() {
ABC_168_B();
return 0;
} | [["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22]] | 1 | 87 |
#include <iostream>
#include <string>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
if (s.size() < k)
cout << s;
else {
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "...";
}
} | #include <iostream>
#include <string>
using namespace std;
int main() {
int k;
cin >> k;
string s;
cin >> s;
if (s.size() <= k)
cout << s;
else {
for (int i = 0; i < k; i++) {
cout << s[i];
}
cout << "...";
}
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 74 |
#include <bits/stdc++.h>
using namespace std;
// typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
// define
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
int main() {
int k;
string s;
cin >> k >> s;
vi t(k + 3);
if (s.size() <= k) {
... | #include <bits/stdc++.h>
using namespace std;
// typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
// define
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
int main() {
int k;
string s;
cin >> k >> s;
vs t(k + 3);
if (s.size() <= k) {
c... | [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]] | 1 | 151 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k, n, i;
char s[105];
cin >> k;
cin >> s;
n = strlen(s);
if (n < k)
cout << s << endl;
else if (n > k) {
for (i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int k, n, i;
char s[105];
cin >> k;
cin >> s;
n = strlen(s);
if (n <= k)
cout << s << endl;
else if (n > k) {
for (i = 0; i < k; i++) {
cout << s[i];
}
cout << "..." << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 94 |
#include <bits/stdc++.h>
#define plskz \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
using namespa... | #include <bits/stdc++.h>
#define plskz \
ios::sync_with_stdio(false); \
cin.tie(NULL); \
cout.tie(NULL);
#define ll long long
using namespa... | [["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 76 |
#include <stdio.h>
int main(void) {
int i, K;
scanf("%d", &K);
char S[100];
scanf("%s", S);
for (i = 0; S[i] != '0'; i++)
;
if (i > K) {
for (int j = 0; j < K; j++) {
printf("%c", S[j]);
}
printf("...\n");
} else
printf("%s", S);
return 0;
} | #include <stdio.h>
int main(void) {
int i, K;
scanf("%d", &K);
char S[100];
scanf("%s", S);
for (i = 0; S[i] != '\0'; i++)
;
if (i > K) {
for (int j = 0; j < K; j++) {
printf("%c", S[j]);
}
printf("...\n");
} else
printf("%s\n", S);
return 0;
} | [["-", 8, 9, 0, 7, 15, 16, 12, 103, 0, 125], ["+", 8, 9, 0, 7, 15, 16, 12, 103, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 115 |
k = int(input())
s = str(input())
if k<len(s):
s = s[:k:1] + "..."
else:
pass
print(k)
print(s)
| k = int(input())
s = str(input())
if k<len(s):
s = s[:k:1] + "..."
else:
pass
print(s)
| [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 48 |
#include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2;
int k, n, i, j;
cin >> k;
cin >> s1;
n = s1.size();
if (n == k)
cout << s1 << endl;
else {
for (i = 0; i < k; i++) {
s2 += s1[i];
}
cout << s2 << "..." << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s1, s2;
int k, n, i, j;
cin >> k;
cin >> s1;
n = s1.size();
if (n <= k)
cout << s1 << endl;
else {
for (i = 0; i < k; i++) {
s2 += s1[i];
}
cout << s2 << "..." << endl;
}
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 89 |
k = int(input())
s = input()
print(s[:k] + '.' * (len(s) - k)) | k=int(input());s=input();print(s[:k]+'.'*3*(len(s)>k))
| [["+", 36, 36, 36, 36, 36, 36, 0, 656, 0, 35], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 17, 48], ["+", 3, 4, 0, 657, 12, 657, 31, 657, 12, 612], ["-", 0, 657, 12, 657, 12, 23, 0, 657, 17, 33], ["+", 0, 657, 12, 657, 12, 23, 0, 666, 667, 47]] | 5 | 34 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.length() <= k) {
cout << s << endl;
}
if (s.length() > 7) {
cout << s.substr(0, k) + "..." << endl;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
string s;
cin >> k >> s;
if (s.length() <= k) {
cout << s << endl;
}
if (s.length() > k) {
cout << s.substr(0, k) + "..." << endl;
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 74 |
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int k;
cin >> k >> s;
for (auto c : s) {
if (!k) {
cout << "...";
break;
}
cout << c;
}
return 0;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
string s;
int k;
cin >> k >> s;
for (auto c : s) {
if (!k) {
cout << "...";
break;
}
cout << c;
--k;
}
return 0;
} | [["+", 0, 338, 8, 9, 0, 1, 0, 27, 17, 68], ["+", 0, 338, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 8, 9, 0, 338, 8, 9, 0, 1, 0, 35]] | 1 | 57 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K;
cin >> S;
if (S.length() < K)
S = S.substr(0, K) + "...";
cout << S << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K;
cin >> S;
if (S.length() > K)
S = S.substr(0, K) + "...";
cout << S << endl;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47]] | 1 | 57 |
import sys
K = int(sys.stdin.readline())
S = sys.stdin.readline()
if len(S) > K:
print(S[:K] + "...")
else:
print(S)
| import sys
K = int(sys.stdin.readline())
# S = sys.stdin.readline()
S = sys.stdin.readline().rstrip()
if len(S) > K:
print(S[:K] + "...")
else:
print(S)
| [["+", 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 | 49 |
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
char s[101] = {};
scanf("%s", s);
int k = strlen(s);
for (int i = 0; i < k; i++) {
s[i] = tolower(s[i]);
}
if (k <= n)
cout << s << endl;
else if (k > n) {
for (int i = 0; i < n; i++) {
... | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
char s[101] = {};
scanf("%s", s);
int k = strlen(s);
for (int i = 0; i < k; i++) {
s[i] = tolower(s[i]);
}
if (k <= n)
cout << s << endl;
else if (k > n) {
for (int i = 0; i < n; i++) {
... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 142 |
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
char s[101] = {};
scanf("%s", s);
int k = strlen(s);
if (k <= n)
cout << s << endl;
else if (k > n) {
for (int i = 0; i < n; i++) {
printf("%c", s[i]);
}
cout << ". . ." << endl;
}
... | #include <bits/stdc++.h>
#include <cmath>
using namespace std;
int main() {
int n;
scanf("%d", &n);
char s[101] = {};
scanf("%s", s);
int k = strlen(s);
if (k <= n)
cout << s << endl;
else if (k > n) {
for (int i = 0; i < n; i++) {
printf("%c", s[i]);
}
cout << "..." << endl;
}
r... | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 113 |
#include <stdio.h>
#include <string.h>
int main(void) {
int k;
scanf("%d", &k);
char s[101];
scanf("%s", s);
if (strlen(s) <= k)
printf("%s", s);
else
for (int i = 0; i < k; i++)
printf("%c", s[i]);
printf("...");
return 0;
} | #include <stdio.h>
#include <string.h>
int main() {
int k;
scanf("%d", &k);
char s[101];
scanf("%s", s);
if (strlen(s) <= k)
printf("%s", s);
else {
for (int i = 0; i < k; i++)
printf("%c", s[i]);
printf("...");
}
} | [["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 40], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 0 | 94 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
using Graph = vector<vector<int>>;
int main() {
ll K;
string S;
cin >> K >> S;
if (S.size() > K) {
cout << S.substr(0, 7) + "..." << endl;
} else {
cout << S << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
using Graph = vector<vector<int>>;
int main() {
ll K;
string S;
cin >> K >> S;
if (S.size() > K) {
cout << S.substr(0, K) + "..." << endl;
} else {
cout << S << endl;
}
}
| [["-", 31, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22]] | 1 | 79 |
/*********************************************************************************\
* _________ _ _ ________ _ _ __ ________ *
* |___ ___|| | | || ______|| | | | / \ | ____ | *
* | | | | | || |______ | |_____| | / /\ \ | |____| | *
* | | | | | ||... | /*********************************************************************************\
* _________ _ _ ________ _ _ __ ________ *
* |___ ___|| | | || ______|| | | | / \ | ____ | *
* | | | | | || |______ | |_____| | / /\ \ | |____| | *
* | | | | | ||... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 391 |
#include <stdio.h>
int main() {
int i, len = 0;
int k;
int limit;
char s[128];
scanf("%d%s", &k, s);
while (s[len]) {
len++;
}
if (limit < len)
limit = len;
else
limit = k;
for (i = 0; i < limit; i++) {
putchar(s[i]);
}
if (k < len) {
printf("...");
}
return 0;
}
| #include <stdio.h>
int main() {
int i, len = 0;
int k;
int limit;
char s[128];
scanf("%d%s", &k, s);
while (s[len]) {
len++;
}
if (k < len)
limit = k;
else
limit = len;
for (i = 0; i < limit; i++) {
putchar(s[i]);
}
if (k < len) {
printf("...");
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 12, 22], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 12, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 22]] | 1 | 107 |
n=gets.to_i
m=gets.chomp
mm=m.chars
mms=mm[0..n-1]
ml=mm.length
if ml>n
v=mms.join("")
puts "#{v}+..."
else
puts m
end | n=gets.to_i
m=gets.chomp
mm=m.chars
mms=mm[0..n-1]
ml=mm.length
if ml>n
v=mms.join
puts "#{v}..."
else
puts m
end | [["-", 64, 749, 0, 662, 12, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 652, 3, 4, 0, 557, 0, 62], ["-", 64, 749, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 64, 749, 0, 652, 3, 4, 0, 557, 0, 6]] | 4 | 54 |
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) begin(v), end(v)
#define fi first
#define se second
template <typename A, typename B> inline bool chmax(A &a, B b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 223 |
<?php
fscanf(STDIN,"%d",$K);
$S = fgets(STDIN);
if(strlen($S) <= $K){
print ($S);
}else{
print substr($S,0,$K)."...";
}
?> | <?php
fscanf(STDIN,"%d",$K);
$S = trim(fgets(STDIN));
if(strlen($S) <= $K){
echo $S;
}else{
print substr($S,0,$K)."...";
}
?> | [["+", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 25], ["-", 0, 57, 8, 9, 0, 1, 0, 619, 0, 620], ["-", 8, 9, 0, 1, 0, 619, 0, 23, 0, 24], ["+", 0, 493, 0, 57, 8, 9, 0, 608, 0, 621], ["-", 8, 9, 0, 1, 0, 619, 0, 23, 0, 25]] | 6 | 60 |
<?php
fscanf(STDIN,"%d",$K);
$S = fgets(STDIN);
if(strlen($S) <= $K){
print ($S);
}else{
print substr($S,0,$K)."...";
}
?> | <?php
fscanf(STDIN,"%d",$K);
$S = trim(fgets(STDIN));
if(strlen($S) <= $K){
print ($S);
}else{
print substr($S,0,$K)."...";
}
?> | [["+", 0, 493, 0, 1, 0, 11, 12, 613, 63, 141], ["+", 0, 1, 0, 11, 12, 613, 3, 3, 0, 24], ["+", 3, 3, 0, 28, 0, 613, 3, 3, 0, 25]] | 6 | 60 |
k=gets.to_i
s=gets.chars
if s.size<=k
puts s.join
elsif s.size>k
puts s[0,k].join + "..."
end | k=gets.to_i
s=gets.chomp
if s.size<=k
puts s
elsif s.size>k
puts s[0,k]+ "..."
end | [["-", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22], ["-", 64, 749, 0, 652, 3, 4, 0, 652, 17, 131], ["-", 64, 749, 0, 652, 3, 4, 0, 652, 735, 22], ["-", 0, 652, 3, 4, 0, 738, 31, 652, 17, 131], ["-", 0, 652, 3, 4, 0, 738, 31, 652, 735, 22]] | 4 | 40 |
k=gets.to_i
s=gets.chars
if s.size<=k
puts s.join
elsif s.size>k
puts s[0,k].join + "..."
end | k=gets.to_i
s=gets.chomp.chars
if s.size<=k
puts s.join
elsif s.size>k
puts s[0,k].join + "..."
end | [["+", 0, 493, 0, 662, 12, 652, 486, 652, 735, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131]] | 4 | 40 |
const Main =
input => {
const inputParsed = input.split("\n");
const number = Number(inputParsed[0]);
if (inputParsed[1].length > number) {
console.log(inputParsed[1].substring(0, number))
} else {
console.log(inputParsed[1])
}
}
Main(require("fs").readFileSync("/d... | const Main =
input => {
const inputParsed = input.split("\n");
const number = Number(inputParsed[0]);
if (inputParsed[1].length > number) {
console.log(inputParsed[1].substring(0, number) + '...')
} else {
console.log(inputParsed[1])
}
}
Main(require("fs").readFile... | [["+", 0, 1, 0, 2, 3, 3, 0, 16, 17, 72], ["+", 0, 2, 3, 3, 0, 16, 12, 557, 0, 104], ["+", 0, 2, 3, 3, 0, 16, 12, 557, 0, 491]] | 2 | 92 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
#define fast \
ios_base::sync_with_stdio(0); ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
using ld = long double;
#define fast \
ios_base::sync_with_stdio(0); ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 248 |
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader reader =
new InputStreamReader(System.in, StandardCharsets.UTF_8);
BufferedReader in = new BufferedReader(reader);
Mai... |
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader reader =
new InputStreamReader(System.in, StandardCharsets.UTF_8);
BufferedReader in = new BufferedReader(reader);
Ma... | [["-", 75, 196, 0, 7, 502, 503, 49, 200, 51, 22], ["+", 75, 196, 0, 7, 502, 503, 49, 200, 51, 499], ["-", 75, 196, 0, 7, 15, 16, 12, 492, 500, 22], ["-", 75, 196, 0, 7, 15, 16, 12, 492, 0, 131], ["-", 75, 196, 0, 7, 15, 16, 12, 492, 141, 22], ["-", 0, 7, 15, 16, 12, 492, 3, 4, 0, 24], ["-", 0, 7, 15, 16, 12, 492, 3, 4,... | 3 | 219 |
#include <iostream>
using namespace std;
int main() {
int l;
cin >> l;
string t;
cin >> t;
int tl;
tl = (int)(t.length());
if (tl > l) {
t.replace(l, tl - l, "…");
}
cout << t;
} | #include <iostream>
using namespace std;
int main() {
int l;
cin >> l;
string t;
cin >> t;
int tl;
tl = (int)(t.length());
if (tl > l) {
t.replace(l, tl - l, "...");
}
cout << t;
} | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 69 |
k=int(input())
s=input()
lng=len(s)
x=s[:k]
if k > lng:
print(s)
else:
print(x+'...') | k=int(input())
s=input()
lng=len(s)
x=s[:k]
if k >= lng:
print(s)
else:
print(x+'...')
| [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]] | 5 | 45 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
int k;
string s;
cin >> k >> s;
int size_s = s.size();
if (size_s >= k) {
rep(i, k) { cout << s[i]; }
cout << "..." << endl;
} else
cout << s << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int main() {
int k;
string s;
cin >> k >> s;
int size_s = s.size();
if (size_s > k) {
rep(i, k) { cout << s[i]; }
cout << "..." << 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 | 79 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int k, a;
string s;
cin >> k >> s;
a = s.size();
if (a >= k) {
s = s.substr(0, k);
cout << s << "...";
return 0;
} else {
cout << s;
return 0;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, a;
string s;
cin >> k >> s;
a = s.size();
if (a > k) {
s = s.substr(0, k);
cout << s << "...";
return 0;
} 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 | 74 |
import math
import sys
k = int(input())
s = input()
if (len(s) >= k):
print(s[0:k] + "...")
else:
print(s)
| import math
import sys
k = int(input())
s = input()
if (len(s) > k):
print(s[0:k] + "...")
else:
print(s)
| [["-", 0, 656, 0, 57, 15, 23, 0, 666, 667, 20], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 47]] | 5 | 46 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int a;
string s;
cin >> a >> s;
int len = s.size();
if (len > a) {
for (int i = 0; i < a; i++) {
cout << s[i];
}
cout << "...";
}
if (len < a)
cout << s;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
int a;
string s;
cin >> a >> s;
int len = s.size();
if (len > a) {
for (int i = 0; i < a; i++) {
cout << s[i];
}
cout << "...";
} else
cout << s;
}
| [["-", 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, 18], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25], ["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 81 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
string sum; //出力する文字列
if (S.size() > K) {
for (int i = 0; i < K; i++) {
sum += S.at(i);
}
cout << sum << "…" << endl;
} else {
cout << S << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
string S;
cin >> K >> S;
string sum; //出力する文字列
if (S.size() > K) { // SがKを上回ったら
for (int i = 0; i < K; i++) {
sum += S.at(i);
}
cout << sum << "..." << endl;
} else {
cout << S << endl;
}
} | [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.