submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s514293969 | p03993 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void) {
long n,l[100000];
int p=0;
cin >> n ;
for (long i = 1; i < n+1; i++) {
cin >> l[i];
}
for (long i = 1; i < n/2+1; i++) {
if (i == l[l[i]]) {
p++;
}
}
std::cout << p << std::endl;
return 0; | a.cc: In function 'int main()':
a.cc:18:18: error: expected '}' at end of input
18 | return 0;
| ^
a.cc:4:16: note: to match this '{'
4 | int main(void) {
| ^
|
s484819405 | p03993 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fr(i,a,b) for(i=a;i<=b;i++)
#define frn(i,a,b) for(i=a;i>=b;i--)
#define mem(arr,val) memset(arr,val,sizeof(arr))
#define mp make_pair
#define pii pair<int,int>
#define F first
#define ... | /tmp/ccCuUIf6.o: in function `main':
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccCuUIf6.o
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccCuUIf6.o
a.cc:(.text+0xaf): relocation trunc... |
s732109915 | p03993 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int[] num = new int[a];
for (int i = 0; i < a; i++) {
num[i] = sc.nextInt();
}
sc.close();
int count = 0;
Map<Integer, Integer> map = new HashMap<Integer, In... | Main.java:17: error: cannot find symbol
if (map.containsKey(key))
^
symbol: variable key
location: class Main
1 error
|
s893931770 | p03993 | C | #include <stdio.h>
#include <stdlib.h>
int main() {
int n;
int *a = malloc(n * sizeof(int));
int result = 0;
for(int i=0; i<n; i++){
scanf("%d", a+i);
}
for(int i=0; i<n; i++){
if(a[i]!=-1 && a[a[i]]=i){
result++;
a[i] = -1;
a[a[i]] = -1;
}
}
printf("%d", result);
} | main.c: In function 'main':
main.c:12:39: error: lvalue required as left operand of assignment
12 | if(a[i]!=-1 && a[a[i]]=i){
| ^
|
s474505045 | p03993 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ni = sc.nextInt();
int au[] = new int[ni];
int nj =1;
int tnum=0;
au[0] = sc.nextInt();
// for (int i=1; i < ni; i++){
// au[i] = sc.nextInt();
// }
for (int i=1; i < ... | Main.java:44: error: reached end of file while parsing
}
^
1 error
|
s397077604 | p03993 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ni = sc.nextInt();
int au[] = new int[ni];
int nj =1;
int tnum=0;
au[0] = sc.nextInt();
// for (int i=1; i < ni; i++){
// au[i] = sc.nextInt();
// }
for (int i=1; i < ... | Main.java:44: error: reached end of file while parsing
}
^
1 error
|
s348652374 | p03993 | C++ | s1 = raw_input()
s2 = raw_input()
s2 = s2.split(" ")
f = 0
for a,b in enumerate(s2):
if s2[b] == str(a):
f++
print f | a.cc:1:1: error: 's1' does not name a type
1 | s1 = raw_input()
| ^~
|
s859802360 | p03993 | C | //#include <iostream>
//#include <algorithm>
//#include <string>
#include <stdio.h>
#include <stdlib.h>
//using namespace std;
//
//bool** CreateMatrix(int N) {
// bool** matrix = new bool*[N];
// for (int i = 0; i < N; ++i)
// matrix[i] = new bool[N];
// return matrix;
//}
bool** CreateMatrix(int N)... | main.c:17:1: error: unknown type name 'bool'
17 | bool** CreateMatrix(int N) {
| ^~~~
main.c:7:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
6 | #include <stdlib.h>
+++ |+#include <stdbool.h>
7 |
main.c: In function 'CreateMatrix':
main... |
s714593669 | p03993 | C | #include <stdio.h>
bool** CreateMatrix(int N) {
bool** matrix = (bool**) malloc(sizeof(char*) * N);
for (int i = 0; i < N; ++i)
matrix[i] = (bool*) malloc(sizeof(char) * N);
return matrix;
}
void ZeroMatrix(bool** matrix, int N) {
for(int i = 0; i < N; i++) {
for(int j = 0; j < N; j++... | main.c:4:1: error: unknown type name 'bool'
4 | bool** CreateMatrix(int N) {
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'CreateMatrix':
main.c... |
s365991558 | p03993 | C++ | int main() {
long int n;
cin >> n;
vector<vector<long int> > friends;
friends.resize(n);
for (long int i = 0; i < n; ++i) {
friends[i].resize(n);
}
for(long int i = 0 ; i < n ; i++) {
for (long int k = 0 ; k < n ; k++) {
friends[i][k] = 0;
}
}
for(long int i = 0 ; i < n ; i++) {
long int place;
... | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> n;
| ^~~
a.cc:5:9: error: 'vector' was not declared in this scope
5 | vector<vector<long int> > friends;
| ^~~~~~
a.cc:5:23: error: expected primary-expression before 'lon... |
s524710812 | p03993 | Java | public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int[] arr = new int[n+1];
for(int i=1;i<=n;i++){
arr[i] = in.nextInt();
}
List<Integer> toAvoid = new ArrayList<>();
int counter = 0;
for(int i=... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s377806107 | p03993 | C++ | int solve(int T, int * r) {
int count = 0;
for (int i = 1; i <= T; i++) {
if (i == r[r[i - 1]])
count++;
}
return count /2;
}
int main() {
int T;
int * rabbits;
cin >> T;
rabbits = new int[T];
for (int i = 0; i < T; i++) {
cin >> rabbits[i];
}
cout << solve(T, rabbits) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:9: error: 'cin' was not declared in this scope
17 | cin >> T;
| ^~~
a.cc:23:9: error: 'cout' was not declared in this scope
23 | cout << solve(T, rabbits) << endl;
| ^~~~
a.cc:23:38: error: 'endl' was not declared in this scope
... |
s707649348 | p03993 | C++ | include <iostream>
#include <vector>
template<typename type>
std::vector<type> input_value(std::istream& ist)
{
type buffer;
std::vector<type> ret;
while (ist >> buffer) {
ret.push_back(buffer);
}
return ret;
}
int main()
{
int count{ 0 };
std::vector<int> rabbits{ input_value<int>(std::cin) };
for ... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu... |
s933232958 | p03993 | C++ | #include <vector>
#include <iostream>
using namespace std;
int countPairs() {
int total;
cin >> total;
vector<int> rabbits;
int r;
int count = 0;
for (int i = 0; i < total; i++) {
cin >> r;
rabbits.push_back(r);
}
for (int i = 0; i < total; i++) {
... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s123422477 | p03993 | C++ | #include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<algorithm>
#define INT unsigned long long int
#define FOR1(n) for(int i=0;i<n;i++)
#define FOR2(j, n) for(int j=0;j<n;j++)
#define FOR3(i, m, n) for(int i=m;i<=... | a.cc:25:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
25 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:45:29: error: expected '}' at end of input
45 | printf("%d\n", ans);
| ^
a.cc:25:7: note: to match this '{'
25 | main()... |
s336768083 | p03993 | C++ | #include <vector>
using namespace std;
int countPairs() {
int total;
std::cin >> total;
vector<int> rabbits;
int r;
int count = 0;
for (int i = 0; i < total; i++) {
std::cin >> r;
rabbits.push_back(r);
}
for (int i = 0; i < total; i++) {
if (rab... | a.cc: In function 'int countPairs()':
a.cc:7:10: error: 'cin' is not a member of 'std'
7 | std::cin >> total;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 | ... |
s884488514 | p03993 | C++ | #include <vector>
using namespace std;
int countPairs() {
int total;
cin >> total;
vector<int> rabbits;
int r;
int count = 0;
for (int i = 0; i < total; i++) {
cin >> r;
rabbits.push_back(r);
}
for (int i = 0; i < total; i++) {
if (rabbits[rabbits... | a.cc: In function 'int countPairs()':
a.cc:7:5: error: 'cin' was not declared in this scope
7 | cin >> total;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <vector>
+++ |+#include <iostream>
2 |
|
s978780176 | p03993 | C++ | #include <vector>
int countPairs() {
int total;
cin >> total;
vector<int> rabbits;
int r;
int count = 0;
for (int i = 0; i < total; i++) {
cin >> r;
rabbits.push_back(r);
}
for (int i = 0; i < total; i++) {
if (rabbits[rabbits[i]-1] == i+1) {
... | a.cc: In function 'int countPairs()':
a.cc:4:5: error: 'cin' was not declared in this scope
4 | cin >> total;
| ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
6 | vector<int> rabbits;
| ^~~~~~
a.cc:6:5: note: suggested alternatives:
In file included from /usr/include/c+... |
s489399528 | p03993 | C++ | #include <iostream>
using namespace std;
int main(){
int size;
cin >> size;
vector<int> arr(size);
for(int i = 0; i < size; i++){
cin >> arr[i];
}
int res = 0;
for(int i = 0; i < size; i++){
if(arr[i] > 0 && arr[i] <= size && i + 1 == arr[arr[i] - 1]){
res++;
arr[i] = 0;
}
}
... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> arr(size);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | u... |
s190998005 | p03993 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;
#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define F... | /tmp/ccsJuXBR.o: in function `main':
a.cc:(.text+0x52): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccsJuXBR.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccsJuXBR.o
a.cc:(.text+0x93): relocation trunc... |
s081829577 | p03993 | C++ | #include <iostream>
using namespace std;
int main(){
int size;
cin >> size;
vector<int> arr(size);
for(int i = 0; i < size; i++){
cin >> arr[i];
}
int res = 0;
for(int i = 0; i < size; i++){
if(arr[i] > 0 && arr[i] <= size && i + 1 == arr[arr[i] - 1]){
res++;
}
}
cout << res;
ret... | a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
6 | vector<int> arr(size);
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | u... |
s494773860 | p03993 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;
#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define F... | /tmp/ccU4xWZW.o: in function `main':
a.cc:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccU4xWZW.o
a.cc:(.text+0x88): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccU4xWZW.o
a.cc:(.text+0xc2): relocation trunc... |
s652382063 | p03993 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N = 0, tmp = 0, count = 0;
vector<int> rabbits;
cin >> N;
for(int i = 0; i < N; i++) {
cin >> tmp;
rabbits.push_back(tmp);
}
for(int i = 0; i < N; i++) {
tmp = rabbits[i];
if(rabbits... | a.cc: In function 'int main()':
a.cc:25:29: error: expected ';' before ':' token
25 | rabbits[i] == -1:
| ^
| ;
|
s925223571 | p03993 | C++ | #include <stdio.h>
int main(void)
{
int N = 0,a[200000] = {0},i = 0,j = 0,k = 0
long long int ans = 0;
scanf("%d",&N);
for(i = 0;i < N;i++)
scanf("%d",&a[i]);
for(i = 0;i < N;i++){
if(a[a[i]] == i){
a[a[i]] = -1;
ans++;
}
}
printf("%d\n",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: expected ',' or ';' before 'long'
6 | long long int ans = 0;
| ^~~~
a.cc:13:25: error: 'ans' was not declared in this scope
13 | ans++;
| ^~~
a.cc:16:23: error: 'ans' was not declared in t... |
s201981377 | p03993 | C++ | #include<iostream>
#include<math.h>
#include<fstream>
#include<string.h>
using namespace std;
int solve(int T, int * r) {
bool * fix = new fix[T];
int count = 0;
for (int i = 0; i < T; i++) {
for (int j = 0; j < T; j++) {
if (j != i) {
if (fix[i] == j && fix[j] == i) {
count++;
}
}
}
}
r... | a.cc: In function 'int solve(int, int*)':
a.cc:9:26: error: 'fix' does not name a type
9 | bool * fix = new fix[T];
| ^~~
|
s793598506 | p03993 | C | #include <stdio.h>
int main(void) {
int n, i, a[999999]={}, sum=0;
scanf("%d", &n);
for(i=1;i<=n;i++)
scanf("%d", &a[i]);
for(i=1;i<=n;i++){
sum++;
}
}
printf("%d\n", sum/2);
return 0;
}
| main.c:16:16: error: expected declaration specifiers or '...' before string constant
16 | printf("%d\n", sum/2);
| ^~~~~~
main.c:16:24: error: unknown type name 'sum'
16 | printf("%d\n", sum/2);
| ^~~
main.c:17:9: error: expected identifier or '(' ... |
s296792285 | p03993 | C | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int N = 0;
int *a = NULL;
scanf("%d", &N);
a = calloc(sizeof(int) * N);
int i;
for (i = 0; i < N; i++) {
scanf("%d", &(a[i]));
}
int friend = 0;
for (i = 0; i < N; i++) {
if (a[a[i]] == i) {
fri... | main.c: In function 'main':
main.c:10:9: error: too few arguments to function 'calloc'
10 | a = calloc(sizeof(int) * N);
| ^~~~~~
In file included from main.c:2:
/usr/include/stdlib.h:675:14: note: declared here
675 | extern void *calloc (size_t __nmemb, size_t __size)
| ^~~~~~... |
s927630147 | p03993 | C | int main(){
int num;
int counter=0;
scanf("%d",num);
int array[num];
for (int i=0;i<num;i++){
scanf("%d",array[i]);
}
for (int i=0;i<num;i++){
if(array[array[i]]=array[i])
count++;
}
return 0;
} | main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
5 | scanf("%d",num);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(){
main.c:5:9: warning: i... |
s267805872 | p03993 | C++ | #include <cstdio>
#include <string>
using namespace std;
int main(){
int N;
int a[10000]={0};
int result2=0;
int result=0;
cin >> N;
for(int i=0;i<N;i++){
cin >> a[i];
}
for(int i=0;i<N;i++){
if(a[a[i]]==i){
... | a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
12 | cin >> N;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <string>
+++ |+#include <iostream>
3 | using ... |
s124249664 | p03993 | C++ | #include <iostream>
using namespace std;
int main(int argc, char *argv[]){
int N;
cin >> N;
int i;
int a[N];
for(i=0; i<N; ++i){
cin >> a[i];
}
int ans = 0;
for(i=0; i<N; ++i){
if(a[a[i]-1] == i+1){
ans++;
}
}
ans /= 2;
cout << ans << endl;
return 0;
}
ogin | a.cc:22:1: error: 'ogin' does not name a type
22 | ogin
| ^~~~
|
s423663381 | p03993 | C++ | #include <iostream>
#define reep(i,n,m) for(int i<(n);i<(m);i++)
#define rep(i,n) reep(i,0,n)
using namespace std;
int a[100000];
int main(){
rep(i,100000){
a[i] = -1;
}
int N;
cin >> N;
int ans=0;
rep(i,N){
int c;
cin >> c;
c--;
if(a[c]==i){
ans++;
}
a[i]=c;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:3:30: error: expected ';' before '<' token
3 | #define reep(i,n,m) for(int i<(n);i<(m);i++)
| ^
a.cc:4:18: note: in expansion of macro 'reep'
4 | #define rep(i,n) reep(i,0,n)
| ^~~~
a.cc:11:9: note: in expansion of ma... |
s177689253 | p03993 | C++ | #include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include ... | a.cc:32:26: warning: extra tokens at end of #include directive
32 | #include <unordered_set>a#include <cstdlib>
| ^
a.cc:32:10: fatal error: unordered_set>: No such file or directory
32 | #include <unordered_set>a#include <cstdlib>
| ^~~~~~~~~~~~~~~~
compilation termi... |
s581337216 | p03993 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_... | a.cc:17:1: error: two or more data types in declaration of 'a'
17 | bool int a[100001];
| ^~~~
a.cc: In function 'int main()':
a.cc:21:25: error: 'a' was not declared in this scope
21 | REP(i,n) cin >> a[i];
| ^
a.cc:23:21: error: 'a' was not declared in this scope
2... |
s014819759 | p03994 | C++ | #include<bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP... | a.cc: In function 'int main()':
a.cc:58:37: error: expected ';' before '}' token
58 | s.back() = 'a'+(s.back()-'a'+k)%26
| ^
| ;
59 | }
| ~
|
s546595066 | p03994 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#in... | a.cc: In function 'void solve()':
a.cc:93:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
93 | signed main() {
| ^~
a.cc:93:12: note: remove parentheses to default-initialize a variable
93 | signed main() {
| ^~
| --
a... |
s220930398 | p03994 | C++ | #include<bits/stdc++.h>
using namespace std;
// function implementing greedy approach
void smallest_string(string s , int m)
{
int n = s.size(); // size of the given string
int a[n]; // declaring an array a
// for each i , a[i] contain number of operations to update s[i] to 'a'
for(int... | a.cc: In function 'void smallest_string(std::string, int)':
a.cc:27:12: error: 'k' was not declared in this scope
27 | if(k >= a[i])
| ^
a.cc:36:5: error: 'k' was not declared in this scope
36 | k = k % 26;
| ^
|
s334959168 | p03994 | C++ | ragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
string s;
ci... | a.cc:1:1: error: 'ragma' does not name a type; did you mean '_Pragma'?
1 | ragma GCC target("avx")
| ^~~~~
| _Pragma
|
s164796733 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF (1LL<<50)
#define MOD 1000000007
int main(){
string S;
int K;
cin >> S >> K;
for(int i=0;i<S.size();i++){
if(S[i]+K>'z'){
K -= 'z' - S[i] + 1;
S... | a.cc: In function 'int main()':
a.cc:20:14: error: 'n' was not declared in this scope
20 | if(S[n-1]=='z'){
| ^
|
s663616743 | p03994 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)();
typedef long long ll;
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
return x... | a.cc: In function 'int main()':
a.cc:39:27: error: 'a' was not declared in this scope
39 | if('z'+1-s[i]<=k&&a[i]!='a'){
| ^
|
s154532074 | p03994 | Java | public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
long k = sc.nextLong();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length() - 1; i++) {
char c = s.charAt(i);
if... | Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s562053350 | p03994 | C++ | #include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <numeric>
#include <climits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
... | a.cc: In function 'int main()':
a.cc:57:10: error: expected ';' before 's'
57 | k %= 26
| ^
| ;
58 | s.back() += k;
| ~
|
s467614393 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
bool allA(string s){
for(char c : s){
if(c != 'a')return false;
}
return true;
}
int main() {
string s ; cin>>s;
int n ; cin>>n;
int m = s.size();
for(int i = 0 ; i < m; ++i){
int pos = s[i] - 'a';
if(26 - pos <= n && s... | a.cc: In function 'int main()':
a.cc:32:16: error: expected ';' before ')' token
32 | for(;norm--){
| ^
| ;
|
s864450652 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
bool allA(string s){
for(char c : s){
if(c != 'a')return false;
}
return true;
}
int main() {
string s ; cin>>s;
int n ; cin>>n;
int m = s.size();
for(int i = 0 ; i < m; ++i){
int pos = s[i] - 'a';
if(26 - pos <= n){
... | a.cc: In function 'int main()':
a.cc:24:33: error: expected primary-expression before ')' token
24 | for(int i = 0 ; i < norm; ++){
| ^
|
s989373099 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
void solve(std::string s, long long K) {
for(int i= 0;i<s.size();i++){
if(i == s.size()-1){K%=26;while(K--)if(s.back == 'z')s.back = 'a'; else s.back++;}
else if(s[i] == 'a')continue;
else if('z'+1-s[i]<=K){
K-='z'+1-s[i];
s[i] = 'a';
... | a.cc: In function 'void solve(std::string, long long int)':
a.cc:6:53: error: invalid operands of types '<unresolved overloaded function type>' and 'char' to binary 'operator=='
6 | if(i == s.size()-1){K%=26;while(K--)if(s.back == 'z')s.back = 'a'; else s.back++;}
| ... |
s981293786 | p03994 | C++ | #include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n)... | a.cc: In function 'int main()':
a.cc:58:53: error: 'n' was not declared in this scope
58 | if( s[sz(s)-1] == 'z'+1 ) s[n-1] = 'a';
| ^
|
s356348627 | p03994 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, a, b) for(int i = a, i##_len = (b); i < i##_len; ++i)
const int mod = 'z' - 'a' + 1;
char next_alphabet(char p, int step) {
return char((p -'a' + step)%mod + 'a');
}
int distance(char a, char b) { // a -> bまでの距離(剰余環)
return (b ... | a.cc:21:3: error: extended character is not valid in an identifier
21 | // 大きいビットから、'a'にする余力があるのなら'a'にしていく
| ^
a.cc: In function 'int main()':
a.cc:21:3: error: '\U00003000' was not declared in this scope
21 | // 大きいビットから、'a'にする余力があるのなら'a'にしていく
| ^~
a.cc:23:38: error: 'i' was not declared ... |
s546043910 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define MOD 1000000007
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
string &func(int index,in... | a.cc: In function 'std::string& func(int, int, std::string&)':
a.cc:20:34: error: continue statement not within a loop
20 | if(s[index]=='a')continue;
| ^~~~~~~~
|
s228112422 | p03994 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
typedef pair<int,int> P;
using ll... | a.cc: In function 'int main()':
a.cc:27:22: error: expected ';' before 'for'
27 | a[s.size()-1]%=26
| ^
| ;
28 | for(Int i=0;i<s.size();i++) cout << (char)(a[i]+'a');
| ~~~
a.cc:28:17: error: 'i' was not declared in this scope
... |
s323094012 | p03994 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<un... | a.cc: In function 'void solve()':
a.cc:62:30: error: expected primary-expression before 'continue'
62 | if(s[i] == 'a') ++i, continue;
| ^~~~~~~~
|
s277939621 | p03994 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<un... | a.cc: In function 'void solve()':
a.cc:57:17: error: 'n' was not declared in this scope
57 | if(i == n - 1) {
| ^
|
s238322567 | p03994 | C++ | #include<bits/stdc++.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=m-1; i>=n; i--)
#define SORT(v,n) do{sort(v,v+n);reverse(v,v+n);}while(0)
#define all(x) (x).begin(),(x).end()
#define... | a.cc: In function 'int main()':
a.cc:320:13: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
320 | cout << s < endl;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-lin... |
s977441708 | p03994 | C++ | #include<bits/stdc++.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=m-1; i>=n; i--)
#define SORT(v,n) do{sort(v,v+n);reverse(v,v+n);}while(0)
#define all(x) (x).begin(),(x).end()
#define... | a.cc: In function 'int main()':
a.cc:320:13: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
320 | cout << s < endl;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-lin... |
s644427935 | p03994 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm> // sort
#define REP(i, n) for (long long i = 0; i < (n); i++)
typedef long long ll;
static const ll mod = 1000000007;
static const ll INF = 1000000000000000000LL;
//999999997000000003
... | a.cc: In function 'int main()':
a.cc:27:24: error: 's' was not declared in this scope
27 | int sa = 'a' - s[i] + 26;
| ^
a.cc:36:13: error: 's' was not declared in this scope
36 | cout << s << endl;
| ^
|
s802139727 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int K;
cin >> K;
for (int i = 0; i < s.size(); ++i) {
if (K <= 0) break;
if (s[i] + K > 'z') {
K -= 'z' - s[i] + 1;
s[i] = 'a';
}
}
s[s.size() - 1] += K;
cout << s << endl; | a.cc: In function 'int main()':
a.cc:20:21: error: expected '}' at end of input
20 | cout << s << endl;
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s586665086 | p03994 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; i <= n; ++i)
#define REPR(i, n) for(int i = n-1; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
... | a.cc: In function 'int main()':
a.cc:28:14: error: 'i' was not declared in this scope
28 | ++ s[i];
| ^
|
s529648404 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
long long int k, size;
cin >> s >> k;
size = s.long();
for(long long int i = 0;i < size;i++){
if(k >= 'z' - s[i] + 1){
k -= 'z' - s[i] + 1;
s[i] = 'a';
}
}
if(k > 0){
k %= 2... | a.cc: In function 'int main()':
a.cc:9:14: error: expected unqualified-id before 'long'
9 | size = s.long();
| ^~~~
|
s484765422 | p03994 | C++ | #include <bits/stdc++.h>
#include <math.h>
#include <cmath>
#include <vector>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
int main(){
string s;
cin >> s;
int sz=s.size();
vector<int> n(sz);
rep(i,sz){
n[i]= 26 - s[i] + 'a';
n[i]%=26
}
int k;
cin ... | a.cc: In function 'int main()':
a.cc:17:13: error: expected ';' before '}' token
17 | n[i]%=26
| ^
| ;
18 | }
| ~
|
s085163979 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
// begin() end()
#define all(x) (x... | a.cc: In function 'int main()':
a.cc:49:16: error: 'k' was not declared in this scope
49 | s.at(N - 1) += k;
| ^
|
s827830095 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
// begin() end()
#define all(x) (x... | a.cc: In function 'int main()':
a.cc:48:1: error: 'k' was not declared in this scope
48 | k %= 26;
| ^
a.cc:49:6: error: 'i' was not declared in this scope
49 | s.at(i) += k;
| ^
|
s984625127 | p03994 | C++ | #include "bits/stdc++.h"
using namespace std;
#define int long long
#define double long double
#define low lower_bound
#define upp upper_bound
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define Rep(i,n) for (int i = (int)(n); i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define rever(vec) reverse(all(v... | cc1plus: error: '::main' must return 'int'
|
s029905293 | p03994 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define ... | a.cc: In function 'void solve()':
a.cc:43:9: error: expected primary-expression before '}' token
43 | }
| ^
|
s579405498 | p03994 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
string s;
int n;cin>>s>>n;
vector<int> a;
for(int i = 0; s.size() > i; i++){
a.push_back(s[i]-'a');
}
for(int i = 0; s.size()-1 > i; i++){
if(!(n-a[i] < 0))a[o]=0,n-=a[i];
cout << (char)('a'+a[i]);
}
cout << (char)('a'+(n... | a.cc: In function 'int main()':
a.cc:12:24: error: 'o' was not declared in this scope
12 | if(!(n-a[i] < 0))a[o]=0,n-=a[i];
| ^
|
s646731041 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
int main() {
string s;
ll k;
cin>>s>>k;
for(int i=0;i<s.size();i++){
ll now=26-(s[i]-'a');
if(k>=now){
s[i]='a';
k-=now;
}
}
if(k>0){
k%=26;
s[s.size()-1]=s[s.size()-1]+k;
}
cout << s;... | a.cc: In function 'int main()':
a.cc:24:9: error: 'retu' was not declared in this scope
24 | retu
| ^~~~
a.cc:24:13: error: expected '}' at end of input
24 | retu
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s462566770 | p03994 | C++ | #include <bits/stdc++.h>
#define itn int
#define rep(i, n) for(int i = 0; i < n; i++)
#define irep(i,n) for(int i = n-1; i>=0; i--)
#define FOR(a,b) for(int i=a; i<b+1; i++)
using namespace std;
typedef long long ll;
int main() {
string s;
cin >> s;
ll k;
cin >> k;
REP(i,s.size()){
int tmp... | a.cc: In function 'int main()':
a.cc:15:9: error: 'i' was not declared in this scope
15 | REP(i,s.size()){
| ^
a.cc:15:5: error: 'REP' was not declared in this scope
15 | REP(i,s.size()){
| ^~~
|
s951151302 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
int K;
cin >> s >> K;
for(int i=0;i<s.length();i++){
else if(K>='a'-s[i]){
K-='a'-s[i];
s[i]='a';
}
}
K=K%26;
s[s.length()-1]=s[s.length()-1]+K;
cout << s;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'else' without a previous 'if'
9 | else if(K>='a'-s[i]){
| ^~~~
|
s293212385 | p03994 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typ... | a.cc: In function 'int main()':
a.cc:46:11: error: 'i' was not declared in this scope
46 | s[i]++;
| ^
|
s902859228 | p03994 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s = sc.next();
long k = sc.nextLong();
StringBuffer sb=new StringBuffer();
for(int i = 0; i<s.length(); i++){
if((26-(s.charAt(i)-'a'))<=k){
k-=26-(s.charAt(i)-'a');
sb.... | Main.java:19: error: ';' expected
sb.append((char)((t+k)%26)));
^
1 error
|
s203772829 | p03994 | C++ | #include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
string s;
int K;
cin >> s >> K;
string ans = s;
int cnt = 0;
for (int i = 0; i < s.size(); i++) {
int t = 'z' - s[i] + 1;
if (cnt + t <= K) {
ans[i] = 'a';
cnt += t;
... | a.cc: In function 'int main()':
a.cc:20:29: error: no matching function for call to 'max(int, long long int)'
20 | c = 'a' + (c - 'a' + max(0, K - cnt)) % 26;
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-g... |
s753722701 | p03994 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string s;
long long x;
cin >> s;
cin >> x;
for(i=0;i<s.size()-1;i++){
if('z'-s[i]+1<=x){
x-='z'-s[i]+1;
s[i]='a';
}
cout << s[i];
}
long long t = s[n-1]-'a';
t=(t+x)%26;
cout << 'a'+t << endl;
return 0;
... | a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
11 | for(i=0;i<s.size()-1;i++){
| ^
a.cc:18:19: error: 'n' was not declared in this scope
18 | long long t = s[n-1]-'a';
| ^
|
s441992552 | p03994 | C++ | #include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define COUTDOUBLE(v) cout << std::setprecision(10)<<(v)<<endl;
#define CIN(n) int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (... | a.cc: In function 'int main()':
a.cc:64:26: error: no matching function for call to 'std::__cxx11::basic_string<char>::push_back()'
64 | ans.push_back();
| ~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
... |
s104882679 | p03994 | C++ | codefestival
100#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-... | a.cc:2:4: error: stray '#' in program
2 | 100#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'codefestival' does not name a type
1 | codefestival
| ^~~~~~~~~~~~
a.cc:41:1: error: 'string' does not name a type
41 | string s;
| ^~~~~~
a.cc: In function 'void init()':
a.cc:46:9: error: 'cin' ... |
s006671113 | p03994 | C++ | #include<bots/stdc++.h>
using namespace std;
int main(){
string s;cin>>s;
int k;cin>>k;
for(int i=0;i<s.size();i++){
int a=s.at(i)-'a';
if(26-a<=k){
s.at(i)='a';
k-=26-a;
}
}
if(k>0){
k%=26;
int b=s.at(s.size()-1)-'a';
if(k>=26-b){
s.at(s.size()-1)='a'+k-(26-b);
}... | a.cc:1:9: fatal error: bots/stdc++.h: No such file or directory
1 | #include<bots/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s108034222 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
signed main () {
string s;
cin >> s;
int k;
cin >> k;
REP(i, s.size()) {
if (i == s.size() - 1) {
if('z' - s[i] >= k) {
s[i... | a.cc: In function 'int main()':
a.cc:23:46: error: 'a' was not declared in this scope
23 | } else if('z' - s[i] + 1 <= k && s[i] != a) {
| ^
|
s194859822 | p03994 | C++ | #include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x) cerr << #x << " = " << (x) << endl;
#de... | a.cc: In function 'int main()':
a.cc:29:41: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'legnth'; did you mean 'length'?
29 | if (S[S.length()-1] == 'z') S[S.legnth()-1] = 'a';
| ^~~~~~
| ... |
s459415732 | p03994 | C | #include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::it... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s719115800 | p03994 | C++ | #include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::it... | a.cc: In function 'int main()':
a.cc:25:31: error: 'concontinue' was not declared in this scope
25 | if(a[i]=='a') concontinue;
| ^~~~~~~~~~~
|
s382330413 | p03994 | C | #include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<stack>
#include<map>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
typedef long long LL;
typedef pair<int,int>PII;
const int inf = 1 << 30;
map<char,int>mp;
map<char,int>::it... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s410050552 | p03994 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;
const int maxn=1e5;
int main(){
int k; char a[maxn+3];
gets(a);
cin>>k;
int n=strlen(a);
for(int i=0;i<n;i++){
if(k>=(int)'z'-a[i]+1){
a[i]='a';
k-=(int)'z'-a[i]+1;
}
}
if(k!=0)a[n-1]+=k;
puts... | a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(a);
| ^~~~
| getw
|
s248258645 | p03994 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
char a[MaxN + 5];
int k;
int main()
{
gets(a);
scanf("%d", &k);
for(int i = 0; i < strlen(a); i++)
{
if(k == 0) break;
if(a[i] == 'a') continue... | a.cc: In function 'int main()':
a.cc:15:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
15 | gets(a);
| ^~~~
| getw
|
s737997073 | p03994 | C++ | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
char str[100005],num[100005];
long long int k;
int main()
{
int i,j,min;
gets(str);
scanf("%lld",&k);
int len = strlen(str);
for(i = 0;i < len; i++)
num[i] = 'z' - str[i] + 1;
for(i = 0;i < len; i++)
{... | a.cc: In function 'int main()':
a.cc:12:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
12 | gets(str);
| ^~~~
| getw
|
s335731278 | p03994 | C | #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long LL;
const int MAXN = 1e5;
char s[MAXN + 5],ans[MAXN + 5];
LL a[MAXN + 5],b[MAXN + 5];
bool q = 0;
LL sum = 0,k = 0;
int main(){
memset(s,0,sizeof(s));
cin >> s+1;
cin >... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s576800714 | p03994 | C++ | #include <cstdio>
#include <string>
#include<iostream>
using namespace std;
char s[100001];
long int k = 0;
int n = 0;
int main(void) {
cin >> s;
cin >> k;
int Len = strlen(s);
for (int i = 0; i < Len; i++) {
if (s[i] != 'a'&&i + 1 != Len) {
//aにするのに必要な数
n = ('z' - s[i]) + 1;
if (k - n >= 0) {
... | a.cc: In function 'int main()':
a.cc:17:19: error: 'strlen' was not declared in this scope
17 | int Len = strlen(s);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<iostream>
+++ |+#include ... |
s819061830 | p03994 | C++ | #include <cstdio>
#include<iostream>
using namespace std;
char s[100001];
long int k = 0;
int n = 0;
int main(void) {
cin >> s;
cin >> k;
int Len = strlen(s);
for (int i = 0; i < Len; i++) {
if (s[i] != 'a'&&i + 1 != Len) {
//aにするのに必要な数
n = ('z' - s[i]) + 1;
if (k - n >= 0) {
k -= n;
s[i]... | a.cc: In function 'int main()':
a.cc:16:19: error: 'strlen' was not declared in this scope
16 | int Len = strlen(s);
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<iostream>
+++ |+#include ... |
s784672159 | p03994 | C++ | #include <cstdio>
#include <string>
#include<iostream>
using namespace std;
int main(void) {
string s;
int k;
cin >> s;
cin >> k;
int sp = 0;
while (k>0)
{
//spが範囲外にならないように
if (s[sp] == 'a'&&sp + 1<s.length) {
sp++;
continue;
}
//aにするのに必要な数
int n = ('z' - s[sp])+1;
if (k - n >= 0){
k... | a.cc: In function 'int main()':
a.cc:20:44: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long uns... |
s587614189 | p03994 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SE... | a.cc: In function 'int main()':
a.cc:34:65: error: 'as' was not declared in this scope; did you mean 's'?
34 | if(s[i] != 'a' && 'z' - s[i] + 1 <= k) k -= 'z' - s[i] + 1,as[i] = 'a';
| ^~
| ... |
s324418705 | p03994 | C++ | #include<bits/stdc++.h>
#define MP make_pair
#define PB push_back
#define PP pop_back()
#define set(x,y) memset(x,y,sizeof(x))
#define MIN3(x,y,z) min(min(x,y),z)
#define MAX3(x,y,z) max(max(x,y),z)
#define ALL(x) x.begin(),x.end()
#define sz(x) (int) x.size()
#define sag node*2+1
#define sol node*2
#define FOR(i,j,k) ... | a.cc: In function 'int main()':
a.cc:45:22: error: unable to find character literal operator 'operator""a' with 'char' argument
45 | s[n]='a'+(s[n]+m-'a'a)%26;
| ^~~~
|
s672671330 | p03994 | C++ | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef __int64 LL;
typedef vector<int> ivec;
typedef vector<string> svec;
int n;
string s;
int main(... | a.cc:13:9: error: '__int64' does not name a type; did you mean '__int64_t'?
13 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
|
s384698854 | p03994 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
string s;
cin >> s;
int siz = s.size();
int K;
cin >> K;
string ret = "";
for(int i = 0;i < siz - 1;i++){
if(s[i] == "a") continue;
int c = s[i];
if(K >= 123 - c){
K -= 123 -... | a.cc: In function 'int main()':
a.cc:19:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
19 | if(s[i] == "a") continue;
|
s583216644 | p03994 | C++ | d | a.cc:1:1: error: 'd' does not name a type
1 | d
| ^
|
s337637343 | p03994 | C++ | #include<iostream>
using namespace std;
int toa(char c){
if(c=='a') return 0;
return ('z'-c+1);
}
int main(void){
int k;
string s,res="";
cin >> s;
cin >> k;
for(int i=0;i<s.length()-1;i++){
if(toa(s[i])>k){
res+="a";
k-=toa(s[i]);
}else{
res+=s[i];
}
}
k%=26;
if(k>'z'-s[i]) k-=26;
res+=s[i]+k;
cout << res;
return 0;... | a.cc: In function 'int main()':
a.cc:21:12: error: 'i' was not declared in this scope
21 | if(k>'z'-s[i]) k-=26;
| ^
a.cc:22:8: error: 'i' was not declared in this scope
22 | res+=s[i]+k;
| ^
|
s150145955 | p03994 | C++ | #include <bits/stdc++.h>
using namespace std;
void solve(string& str, int k)
{
int gap;
int n = str.size();
for(int i=0; i<n; i++)
{
gap = 'z' - str[i] + 1;
if (i!=n-1)
{
if (k>gap)
{
str[i] = 'a';
k= k-gap;
continue;
}else{
continue... | a.cc: In function 'int main()':
a.cc:35:8: error: 'k' was not declared in this scope
35 | cin >> k;
| ^
|
s805134269 | p03994 | Java | public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int count = sc.nextInt();
char[] ca = s.toCharArray();
char[] ca_n = new char[ca.length];
for (int i=0;i<ca_n.length;i++){
ca_n[i] = (char) (... | Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s330773773 | p03994 | C++ | using namespace std;
int main(){
char *str = new char[10000];
int count;
scanf("%s", str);
scanf("%d", &count);
size_t str_len = strlen(str);
int idx = 0;
while(count > 0){
int sub_a = static_cast<int>(str[idx] - 97);
int next2a = static_cast<int>(123 ... | a.cc: In function 'int main()':
a.cc:6:5: error: 'scanf' was not declared in this scope
6 | scanf("%s", str);
| ^~~~~
a.cc:9:5: error: 'size_t' was not declared in this scope
9 | size_t str_len = strlen(str);
| ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is... |
s530347486 | p03994 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s243844008 | p03994 | Java |
import java.util.Iterator;
import java.util.Scanner;
import java.util.Map;
import java.util.HashMap;
import jdk.internal.dynalink.beans.StaticClass;
public class Main {
static final int INF=Integer.MAX_VALUE; // 2147483647
static final long LINF=Long.MAX_VALUE; // 9223372036854775807
public static void mai... | Main.java:8: error: package jdk.internal.dynalink.beans does not exist
import jdk.internal.dynalink.beans.StaticClass;
^
Main.java:41: error: incompatible types: possible lossy conversion from long to int
Ints[n-1] = (Ints[n-1] + k) % 26;
^
2 errors
|
s304620074 | p03994 | Java |
import java.util.Iterator;
import java.util.Scanner;
import java.util.Map;
import java.util.HashMap;
import jdk.internal.dynalink.beans.StaticClass;
public class Main {
static final int INF=Integer.MAX_VALUE; // 2147483647
static final long LINF=Long.MAX_VALUE; // 9223372036854775807
public static void main... | Main.java:7: error: package jdk.internal.dynalink.beans does not exist
import jdk.internal.dynalink.beans.StaticClass;
^
Main.java:40: error: incompatible types: possible lossy conversion from long to int
Ints[n-1] = (Ints[n-1] + k) % 26;
^
2 errors
|
s949123285 | p03994 | C | codefestival
100
| main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
2 | 100
| ^~~
|
s714524501 | p03994 | C | #include<stdio.h>
#include<string.h>
int main() {
char s[100001];
int len;
int loop;
int k;
scanf("%s", s);
scanf("%d", &k);
len = strlen(s);
for (loop = 0; loop < len; loop++) {
if (loop == len - 1) {
s[loop] += k;
do {
s[loop] -= 26;
} while (s[loop] > 'z')
}
else if ('z' - s[loop] < k) ... | main.c: In function 'main':
main.c:19:48: error: expected ';' before '}' token
19 | } while (s[loop] > 'z')
| ^
| ;
20 | }
| ~ ... |
s594714353 | p03994 | C++ | #include <iostream>
#include <string>
using namespace std;
constexpr int32_t posalpha(char ch)
{
return ch - 'a';
}
constexpr char rotate_alpha(char ch, int32_t n)
{
return posalpha(ch) + n < 26 ? ch + n : 'a' + (n < 26 ? n : n % 26);
}
int main(void)
{
int32_t k, temp;
string str;
cin >> str;
cin >> k;
fo... | a.cc: In function 'int main()':
a.cc:33:30: error: 'nth_alpha' was not declared in this scope
33 | str.back() = nth_alpha(k);
| ^~~~~~~~~
|
s016598094 | p03994 | C | //# include <stdio.h>
# include <iostream>
//# include <cstdio>
//# include <conio.h>
/*
Next Letter
Time limit : 2sec / Memory limit : 256MB
Score : 400 points
Problem Statement
Mr. Takahashi has a string s consisting of lowercase English letters.
He repeats the following operation on s exactly K times.
Choose an... | main.c:2:11: fatal error: iostream: No such file or directory
2 | # include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.