submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s068748215 | p03860 | C++ | a = map(str,raw_input().split())
#print a
#print a[1][0]
print a[0][0] + a[1][0] + a[2][0] | a.cc:2:2: error: invalid preprocessing directive #print
2 | #print a
| ^~~~~
a.cc:3:2: error: invalid preprocessing directive #print
3 | #print a[1][0]
| ^~~~~
a.cc:1:1: error: 'a' does not name a type
1 | a = map(str,raw_input().split())
| ^
|
s482305022 | p03860 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
String a = sc.next();
String b = sc.next();
String c = sc.next();
System.out.println(a.charAt(0),b.charAt(0)+c,charAt(0));
}
} | Main.java:10: error: cannot find symbol
System.out.println(a.charAt(0),b.charAt(0)+c,charAt(0));
^
symbol: method charAt(int)
location: class Main
1 error
|
s987213542 | p03860 | Java | import java.util.Scanner;
public class AtCoder01 {
public static void main(String[] args) {
System.out.println("コンテスト名を入力してください。");
Scanner scan = new Scanner(System.in);
String str = scan.nextLine();
String[] resultArray = str.split(" ");
String a = resultArray[0].substring(0,1);
String b = resultArray[1].substring(0,1);
String c = resultArray[2].substring(0,1);
System.out.println(a + b + c);
}
}
| Main.java:2: error: class AtCoder01 is public, should be declared in a file named AtCoder01.java
public class AtCoder01 {
^
1 error
|
s952602645 | p03860 | C++ | #include<string.h>
using namespace std;
int main() {
long long a = 0, b = 0,ad = 0, x = 0, ans = 0;
cin >> a >> b >> x;
if ((a%x) == 0) {
ad = ad - 1;
}
ans = (b / x) - ad;
cout << abs(ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
7 | cin >> a >> b >> x;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include<string.h>
+++ |+#include <iostream>
2 | using namespace std;
a.cc:15:9: error: 'cout' was not declared in this scope
15 | cout << abs(ans);
| ^~~~
a.cc:15:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:17: error: 'abs' was not declared in this scope; did you mean 'ans'?
15 | cout << abs(ans);
| ^~~
| ans
|
s753210111 | p03860 | C++ | a = input().split()
print("A%sC" % a[1][0])
| a.cc:1:1: error: 'a' does not name a type
1 | a = input().split()
| ^
|
s147913352 | p03860 | C++ | a, b, c = input().split()
print("A{0}C".format(b[0])) | a.cc:1:1: error: 'a' does not name a type
1 | a, b, c = input().split()
| ^
|
s609800142 | p03860 | C++ | l = raw_input().split()
print "A"+l[1][0]+"C" | a.cc:1:1: error: 'l' does not name a type
1 | l = raw_input().split()
| ^
|
s554060423 | p03860 | C++ | gets.chomp.split(" ").map{|s| s[0]}.each{|e| print e} | a.cc:1:1: error: 'gets' does not name a type
1 | gets.chomp.split(" ").map{|s| s[0]}.each{|e| print e}
| ^~~~
a.cc:1:36: error: expected unqualified-id before '.' token
1 | gets.chomp.split(" ").map{|s| s[0]}.each{|e| print e}
| ^
|
s080518768 | p03860 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
cin>>s;
cout<<A;
cout<<s[0];
cout<<C;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:7: error: 'A' was not declared in this scope
7 | cout<<A;
| ^
a.cc:9:7: error: 'C' was not declared in this scope
9 | cout<<C;
| ^
|
s382036146 | p03860 | C++ | <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
cin>>s;
cout<<A;
cout<<s[0];
cout<<C;
return 0;
} | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
4 | string s;
| ^~~~~~
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>s;
| ^~~
a.cc:5:6: error: 's' was not declared in this scope
5 | cin>>s;
| ^
a.cc:7:1: error: 'cout' was not declared in this scope
7 | cout<<A;
| ^~~~
a.cc:7:7: error: 'A' was not declared in this scope
7 | cout<<A;
| ^
a.cc:9:7: error: 'C' was not declared in this scope
9 | cout<<C;
| ^
|
s968295212 | p03860 | C++ | a = list(input().split())
print (a[0][0] + a[1][0] + a[2][0])
| a.cc:1:1: error: 'a' does not name a type
1 | a = list(input().split())
| ^
|
s119436367 | p03860 | C++ | print("A"+input().split()[1][0]+"C") | a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token
1 | print("A"+input().split()[1][0]+"C")
| ^
|
s896049305 | p03860 | C++ | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
cin >> s;
cout << "A" + s[0] + "C" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:20: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
7 | cout << "A" + s[0] + "C" << endl;
| ^ ~~~
| |
| const char [2]
|
s676650789 | p03860 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
string s,c;
cin >> s >> c >> s;
cout << A<< c[0] <<C << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'A' was not declared in this scope
6 | cout << A<< c[0] <<C << endl;
| ^
a.cc:6:20: error: 'C' was not declared in this scope
6 | cout << A<< c[0] <<C << endl;
| ^
|
s316484935 | p03860 | C++ | Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
| a.cc:1:1: error: 'Snuke' does not name a type
1 | Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
| ^~~~~
|
s932712505 | p03860 | C++ | Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
| a.cc:1:1: error: 'Snuke' does not name a type
1 | Snuke is going to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
| ^~~~~
|
s934469576 | p03860 | C++ | oing to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
Snuke has decided to abbreviate the name of the contest as "AxC". Here, x is the uppercase English letter at the beginning of s.
Given the name of the contest, print the abbreviation of the name. | a.cc:1:1: error: 'oing' does not name a type
1 | oing to open a contest named "AtCoder s Contest". Here, s is a string of length 1 or greater, where the first character is an uppercase English letter, and the second and subsequent characters are lowercase English letters.
| ^~~~
|
s838098844 | p03860 | C++ | 3 ≤ |s| ≤ 10^5
s consists of lowercase English letters.
No two neighboring characters in s are equal.
Input
The input is given from Standard Input in the following format:
s | a.cc:1:3: error: extended character ≤ is not valid in an identifier
1 | 3 ≤ |s| ≤ 10^5
| ^
a.cc:1:9: error: extended character ≤ is not valid in an identifier
1 | 3 ≤ |s| ≤ 10^5
| ^
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3 ≤ |s| ≤ 10^5
| ^
|
s154334641 | p03860 | C++ | Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first:
Remove one of the characters in s, excluding both ends. However, a character cannot be removed if removal of the character would result in two neighboring equal characters in s.
The player who be | a.cc:1:1: error: 'Takahashi' does not name a type
1 | Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first:
| ^~~~~~~~~
|
s072991504 | p03860 | C++ | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String A = sc.next();
String s = sc.next();
String C = sc.next();
System.out.println("A"+(String.valueOf(s.charAt(0)))+"C");
}
}
| a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s071408319 | p03860 | C++ | #include <studio.h>
int main(void){
char a[100], b;
return 0;
} | a.cc:1:10: fatal error: studio.h: No such file or directory
1 | #include <studio.h>
| ^~~~~~~~~~
compilation terminated.
|
s621801825 | p03860 | C | #include <stdio.h>
int main(void) {
char str1[100],str2[100],str3[100];
scanf("%s %s %s",str1,str2,str3);
printf("%s %s %s\n",str1[0],str2[0],str[0]);
return 0;
} | main.c: In function 'main':
main.c:9:41: error: 'str' undeclared (first use in this function); did you mean 'str3'?
9 | printf("%s %s %s\n",str1[0],str2[0],str[0]);
| ^~~
| str3
main.c:9:41: note: each undeclared identifier is reported only once for each function it appears in
|
s001767098 | p03860 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main (int argc,char* argv[])
{
int i=0;
char s[100];
gets(s);
while(s[i]){
if(i==0)
printf("%c",s[i]);
if(s[i] ==' ')
printf("%c",s[i+1]);
i++;
}
return 0;
}
| a.cc: In function 'int main(int, char**)':
a.cc:9:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s);
| ^~~~
| getw
|
s053833085 | p03860 | C | File Edit Options Buffers Tools C Help
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main (int argc,char* argv[])
{
int i;
char s[100];
gets(s);
for(i=0;i<=100;i++){
if(i==0)
printf("%c",s[i]);
if(s[i] == ' ')
printf("%c",s[i+1]);
}
return 0;
}
| main.c:1:1: error: unknown type name 'File'
1 | File Edit Options Buffers Tools C Help
| ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Options'
1 | File Edit Options Buffers Tools C Help
| ^~~~~~~
main.c:1:11: error: unknown type name 'Options'
In file included from /usr/include/stdio.h:47,
from main.c:2:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
+++ |+#include <stddef.h>
1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t'
37 | size_t __nbytes);
| ^~~~~~
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'?
57 | cookie_read_function_t *read; /* Read bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~
| cookie_seek_function_t
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'?
58 | cookie_write_function_t *write; /* Write bytes. */
| ^~~~~~~~~~~~~~~~~~~~~~~
| cookie_close_function_t
/usr/include/stdio.h:314:35: error: unknown type name 'size_t'
314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
| ^~~~~~
/usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
129 | #include <bits/stdio_lim.h>
+++ |+#include <stddef.h>
130 |
/usr/include/stdio.h:320:47: error: unknown type name 'size_t'
320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW
| ^~~~~~
/usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:340:34: error: unknown type name 'size_t'
340 | int __modes, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:346:24: error: unknown type name 'size_t'
346 | size_t __size) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:385:44: error: unknown type name 'size_t'
385 | extern int snprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:389:45: error: unknown type name 'size_t'
389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen,
| ^~~~~~
/usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:690:30: error: unknown type name 'size_t'
690 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:693:28: error: unknown type name 'size_t'
693 | size_t *__restrict __n, int __delimiter,
| ^~~~~~
/usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:698:27: error: unknown type name 'size_t'
698 | size_t *__restrict __n,
| ^~~~~~
/usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:8: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:728:46: error: unknown type name 'size_t'
728 | extern size_t fread (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:729:22: error: unknown type name 'size_t'
729 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:8: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:735:53: error: unknown type name 'size_t'
735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:736:23: error: unknown type name 'size_t'
736 | size_t __n, FILE *__restrict __s) __nonnull((4));
| ^~~~~~
/usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:8: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:756:55: error: unknown type name 'size_t'
756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:757:31: error: unknown type name 'size_t'
757 | size_t __n, FILE *__restrict __stream) __wur
| ^~~~~~
/usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:8: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:759:62: error: unknown type name 'size_t'
759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
| ^~~~~~
/usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdio.h:760:32: error: unknown type name 'size_t'
760 | size_t __n, FILE *__restrict __stream)
| ^~~~~~
/usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from main.c:3:
/usr/include/stdlib.h:98:8: error: unknown type name 'size_t'
98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
| ^~~~~~
/usr/include/stdlib.h:42:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
41 | # include <bits/waitstatus.h>
+++ |+#include <stddef.h>
42 |
/usr/include/stdlib.h:531:25: error: unknown type name 'size_t'
531 | size_t __statelen) __THROW __nonnull ((2));
| ^~~~~~
/usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:561:25: error: unknown type name 'size_t'
561 | size_t __statelen,
| ^~~~~~
/usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:661:42: error: unknown type name 'size_t'
661 | extern void arc4random_buf (void *__buf, size_t __size)
| ^~~~~~
/usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/stdlib.h:672:22: error: unknown type name 'size_t'
672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
| ^~~~~~
/usr/include/stdlib.h:672:22: note: 'size_t' is defined in heade |
s434956532 | p03860 | C++ | s = gets.split
puts s[0][0] + s[1][0] + s[2][0]
| a.cc:1:1: error: 's' does not name a type
1 | s = gets.split
| ^
|
s260679835 | p03860 | C++ | #include <iostream>
using namespace std;
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <cstdlib>
int main() {
string a;
char temp
for(int i = 0; i < 2; i++) {
cin >> a;
if(i == 1) {
temp = a[0];
}
}
cout << "A" << temp << "C";
return 0;
} | a.cc: In function 'int main()':
a.cc:14:9: error: expected initializer before 'for'
14 | for(int i = 0; i < 2; i++) {
| ^~~
a.cc:14:24: error: 'i' was not declared in this scope
14 | for(int i = 0; i < 2; i++) {
| ^
a.cc:20:24: error: 'temp' was not declared in this scope; did you mean 'tm'?
20 | cout << "A" << temp << "C";
| ^~~~
| tm
|
s613390533 | p03860 | C++ | #include <iostream>
using namespace std;
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <cstdlib>
int main() {
string a;
for(int i = 0; i < 2; i++) {
cin >> a;
if(i == 1) {
temp = a[0];
}
}
cout << "A" << temp << "C";
return 0;
} | a.cc: In function 'int main()':
a.cc:16:25: error: 'temp' was not declared in this scope; did you mean 'tm'?
16 | temp = a[0];
| ^~~~
| tm
a.cc:19:24: error: 'temp' was not declared in this scope; did you mean 'tm'?
19 | cout << "A" << temp << "C";
| ^~~~
| tm
|
s433626319 | p03860 | C++ | #include <iostream>
using namespace std;
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <math.h>
#include <string>
#include <cstdlib>
int main() {
string a;
for(int i = 0; i < 2; i++) {
cin >> a
if(i == 1) {
temp = a[0];
}
}
cout << "A" << temp << "C"
} | a.cc: In function 'int main()':
a.cc:14:25: error: expected ';' before 'if'
14 | cin >> a
| ^
| ;
15 | if(i == 1) {
| ~~
a.cc:19:24: error: 'temp' was not declared in this scope; did you mean 'tm'?
19 | cout << "A" << temp << "C"
| ^~~~
| tm
|
s337574349 | p03860 | C++ | #include<bits/stdc++.h>
#include<string.h>
using namespace std;
main()
{
int i=0;
char a[101];
gets(a);
while(a[i]!=' ')
i++;
cout<<"A"<<a[i+1]<<"C";
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(a);
| ^~~~
| getw
|
s738638083 | p03860 | C++ | #include<bits/stdc++.h>
using namespace std;
main()
{
int i=0;
char a[101];
gets(a);
while(a[i]!=' ')
i++;
cout<<"A"<<a[i+1]<<"C";
} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(a);
| ^~~~
| getw
|
s636992416 | p03860 | C++ | #include <stdio.h>
int main(){
long long int a,b,x;
scanf("%11d,%11d,%11d",&&a,&&b,&&x);
long long int A = [a/x];
long long int B = [b/x];
long long int ans = B-A;
printf("%11d",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:21: error: expected ',' before '/' token
5 | long long int A = [a/x];
| ^
| ,
a.cc:5:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:5:24: error: expected '{' before ';' token
5 | long long int A = [a/x];
| ^
a.cc: In function 'int main()':
a.cc:5:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
5 | long long int A = [a/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:6:21: error: expected ',' before '/' token
6 | long long int B = [b/x];
| ^
| ,
a.cc:6:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:6:24: error: expected '{' before ';' token
6 | long long int B = [b/x];
| ^
a.cc: In function 'int main()':
a.cc:6:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
6 | long long int B = [b/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:4:26: error: label 'a' used but not defined
4 | scanf("%11d,%11d,%11d",&&a,&&b,&&x);
| ^
a.cc:4:30: error: label 'b' used but not defined
4 | scanf("%11d,%11d,%11d",&&a,&&b,&&x);
| ^
a.cc:4:34: error: label 'x' used but not defined
4 | scanf("%11d,%11d,%11d",&&a,&&b,&&x);
| ^
|
s584878651 | p03860 | C++ | #include <stdio.h>
int main(){
long long int a,b,x;
scanf("%11D,%11d,%11d",&&a,&&b,&&x);
long long int A = [a/x];
long long int B = [b/x];
long long int ans = B-A;
printf("%11d",ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:21: error: expected ',' before '/' token
6 | long long int A = [a/x];
| ^
| ,
a.cc:6:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:6:24: error: expected '{' before ';' token
6 | long long int A = [a/x];
| ^
a.cc: In function 'int main()':
a.cc:6:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
6 | long long int A = [a/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:7:21: error: expected ',' before '/' token
7 | long long int B = [b/x];
| ^
| ,
a.cc:7:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:7:24: error: expected '{' before ';' token
7 | long long int B = [b/x];
| ^
a.cc: In function 'int main()':
a.cc:7:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
7 | long long int B = [b/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:5:26: error: label 'a' used but not defined
5 | scanf("%11D,%11d,%11d",&&a,&&b,&&x);
| ^
a.cc:5:30: error: label 'b' used but not defined
5 | scanf("%11D,%11d,%11d",&&a,&&b,&&x);
| ^
a.cc:5:34: error: label 'x' used but not defined
5 | scanf("%11D,%11d,%11d",&&a,&&b,&&x);
| ^
|
s576074340 | p03860 | C++ | #include <stdio.h>
int main(){
long long int a,b,x;
scanf("%11d,%11d,%11d",&&a,&&b,&&c);
long long int A = [a/x];
long long int B = [b/x];
long long int ans = B-A;
printf("%11d,ans);
return 0;
} | a.cc:9:8: warning: missing terminating " character
9 | printf("%11d,ans);
| ^
a.cc:9:8: error: missing terminating " character
9 | printf("%11d,ans);
| ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:21: error: expected ',' before '/' token
6 | long long int A = [a/x];
| ^
| ,
a.cc:6:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:6:24: error: expected '{' before ';' token
6 | long long int A = [a/x];
| ^
a.cc: In function 'int main()':
a.cc:6:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
6 | long long int A = [a/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:7:21: error: expected ',' before '/' token
7 | long long int B = [b/x];
| ^
| ,
a.cc:7:21: error: expected identifier before '/' token
a.cc: In lambda function:
a.cc:7:24: error: expected '{' before ';' token
7 | long long int B = [b/x];
| ^
a.cc: In function 'int main()':
a.cc:7:19: error: cannot convert 'main()::<lambda()>' to 'long long int' in initialization
7 | long long int B = [b/x];
| ^~~~~
| |
| main()::<lambda()>
a.cc:10:1: error: expected primary-expression before 'return'
10 | return 0;
| ^~~~~~
a.cc:5:26: error: label 'a' used but not defined
5 | scanf("%11d,%11d,%11d",&&a,&&b,&&c);
| ^
a.cc:5:30: error: label 'b' used but not defined
5 | scanf("%11d,%11d,%11d",&&a,&&b,&&c);
| ^
a.cc:5:34: error: label 'c' used but not defined
5 | scanf("%11d,%11d,%11d",&&a,&&b,&&c);
| ^
|
s008560821 | p03860 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] str = br.readLine().split(" ");
char c = str[1].substring(0);
sb.append('A'+c+'C');
System.out.println(sb);
}
} | Main.java:12: error: incompatible types: String cannot be converted to char
char c = str[1].substring(0);
^
1 error
|
s535659296 | p03860 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
public class Main {
public static void main(String[] args)throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
String[] str = br.readLine().split(" ");
Char c = str[1].substring(0);
sb.append('A'+c+'C');
System.out.println(sb);
}
} | Main.java:12: error: cannot find symbol
Char c = str[1].substring(0);
^
symbol: class Char
location: class Main
1 error
|
s444744160 | p03860 | C | #include<stdio.h>
int main(){
char s1[100];
char s2[100;
char s3[100;
scanf("%s %s %s",s1,s2,s3);
printf("%c%c%c\n",s1[0],s2[0],s3[0]);
} | main.c: In function 'main':
main.c:4:16: error: expected ']' before ';' token
4 | char s2[100;
| ^
| ]
main.c:12:1: error: expected declaration or statement at end of input
12 | }
| ^
|
s825034209 | p03860 | C++ | #include <cstdio>
#include <cstring>
int main(void) {
char s[200];
gets(s);
printf("A%cC\n", s[8]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:6:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
6 | gets(s);
| ^~~~
| getw
|
s038617141 | p03860 | Java | public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String chaineCaractere = scan.nextLine();
String[] motChaine = chaineCaractere.split(" ");
String raccourciChaine = "";
for (int i = 0; i < motChaine.length; i++){
raccourciChaine = raccourciChaine + motChaine[i].charAt(0);
}
System.out.println(raccourciChaine.toUpperCase());
}
| 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
|
s821056564 | p03860 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner stdIn=new Scanner(System.in);
String a=stdIn.next();
String b=stdIn.next();
String c=stdIn.next();
System.out.print("A"+b.charAt(0)+"C");
}
} | Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s326407827 | p03860 | C++ | #include <stdio.h>
#include <string.h>
int main()
{
int i;
char a[10000];
gets(a);
if(a[0]<='Z'&&a[0]>='A')printf("%c",a[0]);
for(i=0; i<strlen(a); i++)
if(a[i]==' '&&a[i+1]<='Z'&&a[i+1]>='A')printf("%c",a[i+1]);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(a);
| ^~~~
| getw
|
s770359157 | p03860 | Java | import java.util.Scanner;
public class main {
public static void main(String[] args){
Scanner stdIn=new Scanner(System.in);
String a=stdIn.next();
String b=stdIn.next();
String c=stdIn.next();
System.out.print("A"+b.charAt(0)+"C");
}
} | Main.java:2: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s260624576 | p03860 | C++ | # include <stdio.h>
# include <string.h>
# include <stdlib.h>
# include <iostream>
# include <vector>
# include <queue>
# include <stack>
# include <map>
# include <time.h>
# include <math.h>
# include <algorithm>
using namespace std;
# define lowbit(x) ((x)&(-x))
# define pi acos(-1.0)
# define MAXN 250
# define eps 1e-3
# define MAXM 500005
# define MOD 1000000007
# define INF 1000000000
# define MIN(a,b) (a)>(b)?(b):(a)
# define MAX(a,b) (a)<(b)?(b):(a)
# define mem(a,b) memset(a,b,sizeof(a))
# define FOR(i,a,n) for(int i=a; i<=n; ++i)
# define FO(i,a,n) for(int i=a; i<n; ++i)
# define bug puts("H");
typedef long long LL;
typedef unsigned long long ULL;
int main()
{
int i;
char a[10000];
gets(a);
if(a[0]<='Z'&&a[0]>='A')printf("%c",a[0]);
for(i=0; i<strlen(a); i++)
if(a[i]==' '&&a[i+1]<='Z'&&a[i+1]>='A')printf("%c",a[i+1]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:33:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
33 | gets(a);
| ^~~~
| getw
|
s112759211 | p03860 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
char s[200],ch;
while(gets(s)){
ch=s[8];
cout<<"A"<<ch<<"C"<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | while(gets(s)){
| ^~~~
| getw
|
s243152827 | p03860 | C++ | #include <string>
#include <iostream>
int main(){
string second;
string tmp;
for (int i = 0; i < 3; i++) {
if (i == 1) cin >> second;
else cin >> tmp;
}
cout << second << endl;
cout << "A" << second[0] << "C";
return 0;
} | a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
5 | string second;
| ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:6:7: error: expected ';' before 'tmp'
6 | string tmp;
| ^~~~
| ;
a.cc:8:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | if (i == 1) cin >> second;
| ^~~
| std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:24: error: 'second' was not declared in this scope
8 | if (i == 1) cin >> second;
| ^~~~~~
a.cc:9:10: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | else cin >> tmp;
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
9 | else cin >> tmp;
| ^~~
| tm
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | cout << second << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:11:9: error: 'second' was not declared in this scope
11 | cout << second << endl;
| ^~~~~~
a.cc:11:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | cout << second << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s510954038 | p03860 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
char s[200],ch;
gets(s);
ch=s[8];
cout<<"A"<<ch<<"C"<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(s);
| ^~~~
| getw
|
s254387503 | p03860 | C++ | #include <stdio.h>
#include <ctype.h>
#include <string.h>
int main()
{
char szLine[200];
gets(szLine);
char* p = strchr(szLine, ' ');
p++;
char cUp = toupper(*p);
printf("A%cC", cUp);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | gets(szLine);
| ^~~~
| getw
|
s843019896 | p03860 | C++ | #include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
char a[111];
int main()
{
gets(a);
// while()
{
int flag=0;
for(int i=0;i<strlen(a);i++)
{
if(a[i]>='A'&&a[i]<='Z'&&!flag) {cout<<a[i];flag=1;}
if(a[i]==' ') flag=0;
}
}
cout<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
8 | gets(a);
| ^~~~
| getw
|
s743668645 | p03860 | C++ | #include <iostream>
int main() {
__int64 a, b, x;
std::cin >> a >> b >> x;
int ans = (b - a) / x;
if (b%x == 0) {
ans++;
}
std::cout << ans << std::endl;
//system("pause");
} | a.cc: In function 'int main()':
a.cc:4:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
4 | __int64 a, b, x;
| ^~~~~~~
| __int64_t
a.cc:5:21: error: 'a' was not declared in this scope
5 | std::cin >> a >> b >> x;
| ^
a.cc:5:26: error: 'b' was not declared in this scope
5 | std::cin >> a >> b >> x;
| ^
a.cc:5:31: error: 'x' was not declared in this scope
5 | std::cin >> a >> b >> x;
| ^
|
s235771206 | p03860 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string.h>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#define ll long long
#define INF 0x3f3f3f3f
#define clr(x) memset(x,0,sizeof(x))
#define clr2(x) memset(x,INF,sizeof(x))
#define clr3(x) memset(x,-INF,sizeof(x))
#define clr4(x) memset(x,-1,sizeof(x))
#define pb(x) push_back(x)
//#define debug
using namespace std;
const ll mod=1e9+7;
char s[12345];
void solve()
{
gets(s);
int pos=0;
for (int i=0;i<strlen(s);i++)
if (s[i]==' ')
{
pos=i;
break;
}
printf("A%cC",s[pos+1]);
}
int main()
{
#ifdef debug
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:25:4: error: 'gets' was not declared in this scope; did you mean 'getw'?
25 | gets(s);
| ^~~~
| getw
|
s422307075 | p03860 | C++ | #include <stdio.h>
char s[101];
int main()
{
gets(s);
int i=0, cnt=0;
while(s[i]!='\0' && cnt<1)
{
if(s[i+1]==32){ i ++; cnt++; }
i++;
}
printf("A%cC\n", s[i]);
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | gets(s);
| ^~~~
| getw
|
s187990931 | p03860 | C++ | #include <iostream>
#include <cstdio>
#include <cmath>
#include <string.h>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#define ll long long
#define INF 0x3f3f3f3f
#define clr(x) memset(x,0,sizeof(x))
#define clr2(x) memset(x,INF,sizeof(x))
#define clr3(x) memset(x,-INF,sizeof(x))
#define clr4(x) memset(x,-1,sizeof(x))
#define pb(x) push_back(x)
//#define debug
using namespace std;
const ll mod=1e9+7;
char s[12345];
void solve()
{
gets(s);
int pos=0;
for (int i=0;i<strlen(s);i++)
if (s[i]==' ')
{
pos=i;
break;
}
printf("A%cC",s[pos+1]);
}
int main()
{
#ifdef debug
freopen("in.txt","r",stdin);
freopen("out.txt","w",stdout);
#endif
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:25:4: error: 'gets' was not declared in this scope; did you mean 'getw'?
25 | gets(s);
| ^~~~
| getw
|
s181376624 | p03860 | Java | import java.util.Scanner;
/**
* @Author oreid
* @Release 04/12/2016
*/
public class MainA1 {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
scanner.next();
String x = scanner.next();
scanner.close();
System.out.println("A"+ x.charAt(0) + "C");
}
} | Main.java:7: error: class MainA1 is public, should be declared in a file named MainA1.java
public class MainA1 {
^
1 error
|
s363762529 | p03860 | Java | import java.io.*;
import java.util.*;
public class A {
public static void main(String[] args) throws Exception {
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
Scanner s = new Scanner(System.in);
String[] split = f.readLine().split("\\s+");
String res = "";
for(int i= 0; i < split.length; i++) {
res += Character.toUpperCase(split[i].charAt(0));
}
System.out.println(res);
}
} | Main.java:4: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s884288469 | p03860 | C++ | # include <bits/stdc++.h>
# define maxn 300003
# define ll long long
# define clock (clock() * 1000.0 / CLOCKS_PER_SEC)
# define rc(s) return cout << s,0
# define _ ios_base::sync_with_stdio(false);cin.tie(0);
# define pb push_back
# define mp make_pair
using namespace std;
int main(){_
string s1,s2,s3;
cin >> s1 >> s2 >> s3;
cout << s1 << s2[0] << s[3];
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:28: error: 's' was not declared in this scope; did you mean 's3'?
14 | cout << s1 << s2[0] << s[3];
| ^
| s3
|
s066052595 | p03861 | C++ | 1 1000000000000000000 3 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1 1000000000000000000 3
| ^
|
s685910735 | p03861 | Java |
import java.util.*;
public class ccc {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a, b, c;
int count = 0;
a = input.nextInt();
b = input.nextInt();
c = input.nextInt();
for (int i = a; b >= i; i++) {
int s = i % c;
if (s == 0) {
count++;
}
}
System.out.println(count);
if (count == 3) {
System.out.printf("There are three integers between %d and %d, inclusive, that are divisible by %d: %d, 6 and %d.\n", a, b, c, a, b);
}
else
if (count == 6) {
System.out.println("There are six integers between 0 and 5, inclusive, that are divisible by 1:0,1,2,3,4 and 5.");
}
else
if (count == 0) {
System.out.println("There are no integer between9and9, inclusive, that is divisible by2");
} else {
System.out.println("Watch out for integer overflows.");
}
}
}
| Main.java:4: error: class ccc is public, should be declared in a file named ccc.java
public class ccc {
^
1 error
|
s764146659 | p03861 | C++ | #include<iostream>
#include<cmath>
using namespace std;
long long a, b, x;
int main() {
cin >> a >> b >> x;
long long ans = (b / x) - max(0, ((a-1) / x));
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:34: error: no matching function for call to 'max(int, long long int)'
10 | long long ans = (b / x) - max(0, ((a-1) / x));
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:10:34: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
10 | long long ans = (b / x) - max(0, ((a-1) / x));
| ~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
|
s863609429 | p03861 | C | #include <iostream>
#include <stdio.h>
using namespace std;
typedef long long ll;
int main() {
ll a, b, x;
cin >> a >> b >> x;
ll b_num = b / x;
ll a_num = (a - 1) >= 0 ? (a - 1) / x : -1;
printf("%lld\n", b_num - a_num);
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s774648049 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define M 1000000007
long long int power(int a,int b)
{
if(b==0)
return 1;
long long int k=power(a,b/2);
if(b%2==0)
return ((k%M)*(k%M))%M;
else
return ((k%M)*(k%M)*(a%M))%M;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
long long int a,b,x;
cin>>a>>b>>x;
long long int ans= (b-a);
long long int ans=ans/x;
if( a%x==0 && b%x==0)
ans++;
cout<<ans;
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:15: error: redeclaration of 'long long int ans'
27 | long long int ans=ans/x;
| ^~~
a.cc:26:15: note: 'long long int ans' previously declared here
26 | long long int ans= (b-a);
| ^~~
|
s779791391 | p03861 | C++ | #include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a)
#define DEBUG(x)
#define DEBUGS(v)
#endif
/* clang-format on */
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll a, b, x;
cin >> a >> b >> x;
cout << b / x - a / x + (b % x == 0 ? 1 : 0) << endl;
return 0;
}
| a.cc:3:10: fatal error: atcoder/all: No such file or directory
3 | #include <atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s916960590 | p03861 | C++ | using namespace std;
int main() {
long long a, b, x;
cin >> a >> b >> x;
if (a > 0) cout << b / x - (a - 1) / x << endl;
else cout << b / x << endl;
}
| a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> a >> b >> x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:6:14: error: 'cout' was not declared in this scope
6 | if (a > 0) cout << b / x - (a - 1) / x << endl;
| ^~~~
a.cc:6:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:45: error: 'endl' was not declared in this scope
6 | if (a > 0) cout << b / x - (a - 1) / x << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
a.cc:7:8: error: 'cout' was not declared in this scope
7 | else cout << b / x << endl;
| ^~~~
a.cc:7:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:25: error: 'endl' was not declared in this scope
7 | else cout << b / x << endl;
| ^~~~
a.cc:7:25: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
s690657041 | p03861 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
int64_t A, B, C;
cin >> A >> B >> C
if(A % C == 0) {
cout << A / C - B / C + 1 << endl;
}
else {
cout << A / C - B / C << endl;
}
} | a.cc: In function 'int main()':
a.cc:9:21: error: expected ';' before 'if'
9 | cin >> A >> B >> C
| ^
| ;
10 | if(A % C == 0) {
| ~~
a.cc:13:3: error: 'else' without a previous 'if'
13 | else {
| ^~~~
|
s257987633 | p03861 | C++ | a, b, x = map(int, input().split())
total1 = 0
for i in range (a, b+1):
if i % x == 0:
total1 += 1
print(total1) | a.cc:1:1: error: 'a' does not name a type
1 | a, b, x = map(int, input().split())
| ^
|
s820208658 | p03861 | C++ | a,b,x=map(int,input().split())
cnt=0
c=a//x
d=b//x
print(int(d-c)) | a.cc:1:1: error: 'a' does not name a type
1 | a,b,x=map(int,input().split())
| ^
|
s867903497 | p03861 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,i,x;
sacnf("%d%d%d",&a,&b,&x);
c=0;
for(i=a;i<=b;i++) if(i%x==0) c+=1;
printf("%d\n",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
7 | sacnf("%d%d%d",&a,&b,&x);
| ^~~~~
| scanf
|
s284416019 | p03861 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,i,x;
sacnf("%d%d%d",&a,&b,&x);
c=0;
for(i=a;i<=b;i++) if(i%x=0) c+=1;
printf("%d\n",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
7 | sacnf("%d%d%d",&a,&b,&x);
| ^~~~~
| scanf
a.cc:9:25: error: lvalue required as left operand of assignment
9 | for(i=a;i<=b;i++) if(i%x=0) c+=1;
| ~^~
|
s179201888 | p03861 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,i,x;
sacnf("%d%d%d",&a,&b,&x);
c=0;
for(i=a;i<=b,i++) if(i%x=0) c+=1;
printf("%d\n",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:3: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
7 | sacnf("%d%d%d",&a,&b,&x);
| ^~~~~
| scanf
a.cc:9:19: error: expected ';' before ')' token
9 | for(i=a;i<=b,i++) if(i%x=0) c+=1;
| ^
| ;
a.cc:9:25: error: lvalue required as left operand of assignment
9 | for(i=a;i<=b,i++) if(i%x=0) c+=1;
| ~^~
|
s247838880 | p03861 | C++ | #include<stdio.h>
int main(void)
{
int a,b,c,i;
sacnf("%d%d%d",&a,&b,&x);
c=0;
for(i=a;i<=b,i++) if(i%x=0) c+=1;
printf("%d\n",c);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:25: error: 'x' was not declared in this scope
7 | sacnf("%d%d%d",&a,&b,&x);
| ^
a.cc:7:3: error: 'sacnf' was not declared in this scope; did you mean 'scanf'?
7 | sacnf("%d%d%d",&a,&b,&x);
| ^~~~~
| scanf
a.cc:9:19: error: expected ';' before ')' token
9 | for(i=a;i<=b,i++) if(i%x=0) c+=1;
| ^
| ;
|
s322099451 | p03861 | C++ | # cook your dish here
li=list(map(int,input().split()))
if li[0]==li[1]:
k=int(li[0]//li[2])
if k*li[2]==li[0]:
print(1)
else:
print(0)
elif li[0]<li[2]:
if li[0]==0:
print(li[1]//li[2]+1)
else:
print(li[1]//li[2])
else:
print((li[1]//li[2])-(li[0]//li[2])+1) | a.cc:1:3: error: invalid preprocessing directive #cook
1 | # cook your dish here
| ^~~~
a.cc:3:1: error: 'li' does not name a type
3 | li=list(map(int,input().split()))
| ^~
|
s233928254 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int64_t a,b,x;
cin >> a >> b >> x;
int64_t asum = a / x;
if( (a % x) == 0){
asum++;
}
int64_t bsum = b / x;
cout << ssum - bsum << endl;
} | a.cc: In function 'int main()':
a.cc:15:11: error: 'ssum' was not declared in this scope; did you mean 'bsum'?
15 | cout << ssum - bsum << endl;
| ^~~~
| bsum
|
s053449473 | p03861 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const ll INF_LL = 1001001001001001001LL;
void solver(ll a,ll b,ll x){
ll ans = b/x;
ans -= a/x;
cout << ans2 << endl;
}
int main(void){
ll a,b,x; cin >> a >> b >> x;
solver(a,b,x);
return 0;
}
| a.cc: In function 'void solver(ll, ll, ll)':
a.cc:13:11: error: 'ans2' was not declared in this scope; did you mean 'ans'?
13 | cout << ans2 << endl;
| ^~~~
| ans
|
s295195795 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ll int a,b,x,c=0;
cin>>a>>b>>x;
b=b/x + 1;
if(a!=0)
a=(a-1)/x + 1;
cout<<(b-a)<<endl;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
5 | ll int a,b,x,c=0;
| ^~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:20: error: 'x' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
|
s783863996 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ll int a,b,x,c=0;
cin>>a>>b>>x;
for(ll int i=a;i<=b;i++){
if(i%x==0)
c++;
}
cout<<c<<endl;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
5 | ll int a,b,x,c=0;
| ^~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:20: error: 'x' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:7:15: error: expected ';' before 'int'
7 | for(ll int i=a;i<=b;i++){
| ^~~~
| ;
a.cc:7:24: error: 'i' was not declared in this scope
7 | for(ll int i=a;i<=b;i++){
| ^
a.cc:9:25: error: 'c' was not declared in this scope
9 | c++;
| ^
a.cc:11:15: error: 'c' was not declared in this scope
11 | cout<<c<<endl;
| ^
|
s109493091 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll a, b, x;
cin >> a >> b >> x;
cout << (b / x - max(a - 1, 0) / x) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:25: error: no matching function for call to 'max(ll, int)'
8 | cout << (b / x - max(a - 1, 0) / x) << endl;
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
8 | cout << (b / x - max(a - 1, 0) / x) << endl;
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
8 | cout << (b / x - max(a - 1, 0) / x) << endl;
| ~~~^~~~~~~~~~
|
s376222058 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl '\n'
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define TOUPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)
#define TOLOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define FILLZERO(s, n) \
do { \
ostringstream os; \
os << setw(n) << setfill('0') << s; \
s = os.str(); \
} while (0);
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
#define INIT \
std::cin.tie(nullptr); \
std::ios_base::sync_with_stdio(false); \
cout << std::fixed << std::setprecision(10);
template <typename T>
vector<T> make_vec(size_t a, T n) { return vector<T>(a, n); }
template <typename T, typename... Ts>
auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); }
template <class T>
inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
for (T &x : vec)
is >> x;
return is;
}
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;
signed main() {
INIT;
cin >> A >> B >> X;
cout << B / X - max((A - 1), 0) / X << endl;
} | a.cc: In function 'int main()':
a.cc:73:24: error: no matching function for call to 'max(long long int, int)'
73 | cout << B / X - max((A - 1), 0) / X << endl;
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:73:24: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
73 | cout << B / X - max((A - 1), 0) / X << endl;
| ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:73:24: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
73 | cout << B / X - max((A - 1), 0) / X << endl;
| ~~~^~~~~~~~~~~~
|
s860185776 | p03861 | C++ | #include "bits/stdc++.h"
using namespace std;
using ll = long long;
ll calc(ll n, ll x) {
return (n / x);
}
int main() {
ll a, b, x; cin >> a >> b >> x;
ll ans = calc(b, x) - calc(max(a-1, 0), x);
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:12:35: error: no matching function for call to 'max(ll, int)'
12 | ll ans = calc(b, x) - calc(max(a-1, 0), x);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:12:35: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
12 | ll ans = calc(b, x) - calc(max(a-1, 0), x);
| ~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:12:35: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
12 | ll ans = calc(b, x) - calc(max(a-1, 0), x);
| ~~~^~~~~~~~
|
s216491430 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
long long division(long long n, long long x){
if(n==0){
return 0;
}else if(n!=0{
return x/n;
}
}
int main(){
long long a,b,x;
cin>>a>>b>>x;
if(a==0){
cout<<division(b,x);
}else{
cout<<division(b,x)-division(a-1,x)<<endl;
}
return 0;
}
| a.cc: In function 'long long int division(long long int, long long int)':
a.cc:6:18: error: expected ')' before '{' token
6 | }else if(n!=0{
| ~ ^
| )
a.cc:10:1: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
|
s699501457 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
long long division(long long n, long long x){
if(n==0){
return 0;
}else if(n!=0{
return x/n;
}
}
int main(){
long long a,b,x;
cin>>a>>b>>x;
if(a=0){
cout<<division(b,x);
}else{
cout<<division(b,x)-division(a-1,x)<<endl;
}
return 0;
}
| a.cc: In function 'long long int division(long long int, long long int)':
a.cc:6:18: error: expected ')' before '{' token
6 | }else if(n!=0{
| ~ ^
| )
a.cc:10:1: error: expected primary-expression before '}' token
10 | }
| ^
a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type]
|
s737174342 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int divi(int i,int j) {
int x=i/j;
return x;
}
int main() {
int a, b, x;
cin >> a >> b>> x;
int y=O;
if (a<=0) y=divi(b,x)-divi(a-1,x);
else y=divi(b,x);
cout << y << endl;
}
| a.cc: In function 'int main()':
a.cc:12:9: error: 'O' was not declared in this scope
12 | int y=O;
| ^
|
s595923261 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int divi(int i,int j) {
int x=i/j;
return x;
}
int main() {
int a, b, x;
cin >> a >> b>> x;
y=divi(b,x)-divi(a-1,x);
cout << y << endl;
}
| a.cc: In function 'int main()':
a.cc:12:3: error: 'y' was not declared in this scope
12 | y=divi(b,x)-divi(a-1,x);
| ^
|
s982651356 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int div(int i,int j) {
int x=i/j;
return x;
}
int main() {
int a, b, x;
cin >> a >> b>> x;
y=div(b,x)-div(a-1,x);
cout << y << endl;
}
| a.cc:4:5: error: ambiguating new declaration of 'int div(int, int)'
4 | int div(int i,int j) {
| ^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
from a.cc:1:
/usr/include/stdlib.h:992:14: note: old declaration 'div_t div(int, int)'
992 | extern div_t div (int __numer, int __denom)
| ^~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'y' was not declared in this scope
12 | y=div(b,x)-div(a-1,x);
| ^
a.cc:12:13: error: no match for 'operator-' (operand types are 'div_t' and 'div_t')
12 | y=div(b,x)-div(a-1,x);
| ~~~~~~~~^~~~~~~~~~~
| | |
| div_t div_t
In file included from /usr/include/c++/14/bits/stl_algobase.h:67,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
618 | operator-(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::reverse_iterator<_Iterator>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1790 | operator-(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::move_iterator<_IteratorL>'
12 | y=div(b,x)-div(a-1,x);
| ^
In file included from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:370:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const complex<_Tp>&)'
370 | operator-(const complex<_Tp>& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:370:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::complex<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/complex:379:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&, const _Tp&)'
379 | operator-(const complex<_Tp>& __x, const _Tp& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:379:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::complex<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/complex:388:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const _Tp&, const complex<_Tp>&)'
388 | operator-(const _Tp& __x, const complex<_Tp>& __y)
| ^~~~~~~~
/usr/include/c++/14/complex:388:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::complex<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/complex:465:5: note: candidate: 'template<class _Tp> std::complex<_Tp> std::operator-(const complex<_Tp>&)'
465 | operator-(const complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:465:5: note: candidate expects 1 argument, 2 provided
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/bits/valarray_after.h:406:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename std::__fun<std::__minus, typename _Dom1::value_type>::result_type> std::operator-(const valarray<typename _Dom::value_type>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
406 | _DEFINE_EXPR_BINARY_OPERATOR(-, struct std::__minus)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:406:5: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::_Expr<_Dom1, typename _Dom1::value_type>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::valarray<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_ValArray, std::_Constant, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::valarray<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
/usr/include/c++/14/valarray:1197:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::__minus, std::_Constant, std::_ValArray, _Tp, _Tp>, typename std::__fun<std::__minus, _Tp>::result_type> std::operator-(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
1197 | _DEFINE_BINARY_OPERATOR(-, __minus)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/valarray:1197:1: note: template argument deduction/substitution failed:
a.cc:12:23: note: 'div_t' is not derived from 'const std::valarray<_Tp>'
12 | y=div(b,x)-div(a-1,x);
| ^
|
s131401669 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, x;
cin >> a >> b>> x;
int counter=0;
for (int i=a;i<=b;i++) {
if (i%x==o) {
counter++;
}
}
cout << counter << endl;
}
| a.cc: In function 'int main()':
a.cc:9:14: error: 'o' was not declared in this scope
9 | if (i%x==o) {
| ^
|
s606275609 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, x;
cin >> a >> b>> x;
int counter=0;
for (int i=a;i<=b;i++) {
if (i%x==o) {
count++;
}
}
cout << counter << endl;
} | a.cc: In function 'int main()':
a.cc:9:14: error: 'o' was not declared in this scope
9 | if (i%x==o) {
| ^
a.cc:10:12: error: no post-increment operator for type
10 | count++;
| ^~
|
s847343439 | p03861 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long x = in.nextLong();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = in.nextLong();
}
long count = 0;
for (int i = 1; i < n; i++) {
long sum = a[i] + a[i - 1];
if (sum > x) {
long t = sum - x;
count += t;
a[i] -= t;
}
}
System.out.println(count);
}
}
| Main.java:9: error: incompatible types: possible lossy conversion from long to int
long[] a = new long[n];
^
1 error
|
s640492389 | p03861 | C++ | #include <iostream>
using namespace std;
void solve(){
long long a, b, x; cin >> a >> b >> x;
if(x == 1) {
cout << b-a+1 << endl;
return 0;
}
long long total = b/x+1;//0-bまでで割り切れるもの
long long totala = (a-1)/x+1;//0~a-1までで割り切れるもの
cout << total-totala << endl;
}
int main(){
solve();
return 0;
}
| a.cc: In function 'void solve()':
a.cc:8:14: error: return-statement with a value, in function returning 'void' [-fpermissive]
8 | return 0;
| ^
|
s572856953 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a, b, x;
cin >> a >> b >> x;
if(x == 1) {
cout << b-a+1 << endl;
return;
}
long long z = b/x;
long long y = (a-1)/x;
if(a == 0) y == -1;
cout << z-y<< endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
10 | return;
| ^~~~~~
|
s273065042 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a, b, x;
cin >> a >> b >> x;
if(x == 1) {
cout << b-a+1 << endl;
return ;
}
long long z = b/x;
long long y = (a-1)/x;
if(a == 0) y == -1;
cout << z-y<< endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
10 | return ;
| ^~~~~~
|
s417115555 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long a,b,x;
long long n;
cin>>a>>b>>x;
if(b-a+1<x){
n=(b-a)/x+1
if (b%x==0){
n=1;
}
else if(a%x==0){
n=1;
}
}
cout<<n;
} | a.cc: In function 'int main()':
a.cc:8:28: error: expected ';' before 'if'
8 | n=(b-a)/x+1
| ^
| ;
9 | if (b%x==0){
| ~~
a.cc:12:17: error: expected '}' before 'else'
12 | else if(a%x==0){
| ^~~~
a.cc:7:20: note: to match this '{'
7 | if(b-a+1<x){
| ^
a.cc: At global scope:
a.cc:17:9: error: 'cout' does not name a type
17 | cout<<n;
| ^~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s679674821 | p03861 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int main (){
long long a, b, x;
cin >> a >> b >> x;
long long sol = (b - a) / x;
/*
if (a % x == 0 || b % x == 0){
sol ++;
} else if (a % x != 0 && b % x != 0 && (b - a) % x != 0){
sol = round((b - a) / x);
}
*/
if (a % x == 0 && b % x=!= 0 && (b - a) % x == 0){
sol ++;
} else {
sol = round((b - a) / x);
}
cout << sol << '\n';
}
| a.cc: In function 'int main()':
a.cc:16:27: error: expected primary-expression before '!=' token
16 | if (a % x == 0 && b % x=!= 0 && (b - a) % x == 0){
| ^~
|
s735517793 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
long long a,b,x;
cin >> a >> b >> x;
/*
for(long long i=a; i<=b; i++){
if( i % x == 0){
count++;
}
}
*/
long long pivot = a, ans=0;
while(true){
if(pivot%x==0){
long long diff = b-pivot;
cout << 1+(diff/x) << '\n';
return;
}
pivot++;
if(pivot>b){
cout << 0 << '\n';
return;
}
}
}
| a.cc: In function 'int main()':
a.cc:19:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
19 | return;
| ^~~~~~
a.cc:24:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
24 | return;
| ^~~~~~
|
s747472664 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
long long a,b,x,count=0;
cin >> a >> b >> x;
/*
for(long long i=a; i<=b; i++){
if( i % x == 0){
count++;
}
}
*/
long long pivot = a, ans=0;
while(true){
if(pivot%x==0){
long long diff = b-pivot;
cout << 1+(diff/x) << '\n';
return;
}
pivot++;
if(pivot>b){
cout << 0 << '\n';
return;
}
}
}
| a.cc: In function 'int main()':
a.cc:19:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
19 | return;
| ^~~~~~
a.cc:24:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
24 | return;
| ^~~~~~
|
s051913567 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
longlong a,b,x;
cin>>a>>b>>x;
int y=0;
for(int i=0;i<b-a+1;i++){
if((a+i)%x==0){
y+=1;
}
}
cout<<y;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'longlong' was not declared in this scope
5 | longlong a,b,x;
| ^~~~~~~~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:20: error: 'x' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
|
s449983429 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
longlong a,b,x;
cin>>a>>b>>x;
int y=0;
for(int i=0;i<b-a+1;i++){
if(a%x==0){
y+=1;
}
}
cout<<y;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'longlong' was not declared in this scope
5 | longlong a,b,x;
| ^~~~~~~~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
a.cc:6:20: error: 'x' was not declared in this scope
6 | cin>>a>>b>>x;
| ^
|
s260325529 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
longlong a,b,x;
cin<<a<<b<<x;
int y=0;
for(int i=0;i<b-a+1;i++){
if(a%x==0){
y+=1;
}
}
cout<<y;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'longlong' was not declared in this scope
5 | longlong a,b,x;
| ^~~~~~~~
a.cc:6:14: error: 'a' was not declared in this scope
6 | cin<<a<<b<<x;
| ^
a.cc:6:17: error: 'b' was not declared in this scope
6 | cin<<a<<b<<x;
| ^
a.cc:6:20: error: 'x' was not declared in this scope
6 | cin<<a<<b<<x;
| ^
|
s412090278 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define ar array
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
template<class T>
bool umin(T &a, const T &b) {
return b < a ? a = b, 1 : 0;
}
template<class T>
bool umax(T &a, const T &b) {
return a < b ? a = b, 1 : 0;
}
template<class A>
void read(vt<A> &v);
template<class A, size_t S>
void read(ar<A, S> &a);
template<class T>
void read(T &x) {
cin >> x;
}
void read(double &d) {
string t;
read(t);
d = stod(t);
}
void read(long double &d) {
string t;
read(t);
d = stold(t);
}
template<class H, class... T>
void read(H &h, T &... t) {
read(h);
read(t...);
}
template<class A>
void read(vt<A> &x) {
EACH(a, x)read(a);
}
template<class A, size_t S>
void read(array<A, S> &x) {
EACH(a, x)read(a);
}
string to_string(char c) {
return string(1, c);
}
string to_string(bool b) {
return b ? "true" : "false";
}
string to_string(const char *s) {
return string(s);
}
string to_string(string s) {
return s;
}
string to_string(vt<bool> v) {
string res;
FOR(sz(v))res += char('0' + v[i]);
return res;
}
template<size_t S>
string to_string(bitset<S> b) {
string res;
FOR(S)res += char('0' + b[i]);
return res;
}
template<class T>
string to_string(T v) {
bool f = 1;
string res;
EACH(x, v) {
if (!f)
res += ' ';
f = 0;
res += to_string(x);
}
return res;
}
template<class A>
void write(A x) {
cout << to_string(x);
}
template<class H, class... T>
void write(const H &h, const T &... t) {
write(h);
write(t...);
}
void print() {
write("\n");
}
template<class H, class... T>
void print(const H &h, const T &... t) {
write(h);
if (sizeof...(t))
write(' ');
print(t...);
}
template<class T, class U>
void vti(vt<T> &v, U x, size_t n) {
v = vt<T>(n, x);
}
template<class T, class U>
void vti(vt<T> &v, U x, size_t n, size_t m...) {
v = vt<T>(n);
EACH(a, v)vti(a, x, m);
}
int cmp(int a, int b) {
if (a == b) {
return 0;
}
return a < b ? -1 : 1;
}
void solve() {
int a, b, x;
read(a, b, x);
int cnt = (b / x) - (a / x);
if (a % x == 0) c++;
print(c);
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tt = 1;
// read(tt);
FOR(tt) {
// write("Case #", i + 1, ": ");
solve();
}
}
| a.cc: In function 'void solve()':
a.cc:158:21: error: 'c' was not declared in this scope
158 | if (a % x == 0) c++;
| ^
a.cc:159:11: error: 'c' was not declared in this scope
159 | print(c);
| ^
|
s400179334 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353
int main() {
ll a, b, x; cin >> a >> b >> x;
ll left = a / x, right = b / x;
ll ans;
if(a % x == 0) left--;f
ans = right - left;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:19:31: error: 'f' was not declared in this scope
19 | if(a % x == 0) left--;f
| ^
|
s676253580 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define PI 3.141592653589793
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
int main() {
ll a,b,x;
cin >> a >> b >> x;
ll ans = 0;
ans = min(0,(b - a - 1)) / x;
if(a % x == 0) ans++;
if(a != b && b % x == 0) ans++;
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:12:14: error: no matching function for call to 'min(int, ll)'
12 | ans = min(0,(b - a - 1)) / x;
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:12:14: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
12 | ans = min(0,(b - a - 1)) / x;
| ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
5686 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
5696 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: template argument deduction/substitution failed:
a.cc:12:14: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
12 | ans = min(0,(b - a - 1)) / x;
| ~~~^~~~~~~~~~~~~~~
|
s659873338 | p03861 | C++ |
typedef unsigned long ULONG;
using namespace std;
int main(){
ULONG a, b, x;
cin >> a >> b >> x;
cout << b/x - (a-1UL)/x << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
7 | cin >> a >> b >> x;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:9:3: error: 'cout' was not declared in this scope
9 | cout << b/x - (a-1UL)/x << endl;
| ^~~~
a.cc:9:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:30: error: 'endl' was not declared in this scope
9 | cout << b/x - (a-1UL)/x << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 |
|
s785036254 | p03861 | C++ |
// Problem : B - Between a and b ...
// Contest : AtCoder - AtCoder Beginner Contest 048
// URL : https://atcoder.jp/contests/abc048/tasks/abc048_b
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
/*⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣠⣶⡾⠏⠉⠙⠳⢦⡀⠀⠀⠀
⠀⠀⠀⣴⠿⠏⠀⠀⠀⠀⠀⠀⢳⡀⠀
⠀⠀⢠⣟⣋⡀⢀⣀⣀⡀⠀⣀⡀⣧⠀
⠀⠀⢸⣯⡭⠁⠸⣛⣟⠆⡴⣻⡲⣿⠀
⠀⠀⣟⣿⡭⠀⠀⠀⠀⠀⢱⠀⠀⣿⠀
⠀⠀⠙⢿⣯⠄⠀⠀⠀⢀⡀⠀⠀⡿⠀⠀
⠀⠀⠀⠀⠹⣶⠆⠀⠀⠀⠀⠀⡴⠃⠀⠀
⠀⠀⠀⠀⠀⢸⣷⡦⢤⡤⢤⣞⣁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢀⣤⣴⣿⣏⠁⠀⠀⠸⣏⢯⣷⣖⣦⡀⠀⠀⠀⠀⠀⠀
⢀⣾⣽⣿⣿⣿⣿⠛⢲⣶⣾⢉⡷⣿⣿⠵⣿⠀⠀⠀⠀⠀⠀
⣼⣿⠍⠉⣿⡭⠉⠙⢺⣇⣼⡏⠀⠀⠀⣄⢸⠀⠀⠀⠀⠀⠀
⣿⣿⣧⣀⣿.........⣀⣰⣏⣘⣆⣀⠀
*/
#include <iostream>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a) for (int i=0; i<(a); i++)
#define rep1(i,a,b) for (int i = (b)-1; i >= a; i--)
#define rep(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
#define imax INT_MAX
#define imin INT_MIN
//#define MOD 998244353
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1000000007;
const char nl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
signed main() {
ll a,b,x;
cin>>a>>b>>x;
cout<<b/x-a/x+(a%x==0)?1:0;
return 0;
}
// read the question correctly (ll vs int)
// template by bqi343 | a.cc:25:17: error: '__gnu_pbds' is not a namespace-name
25 | using namespace __gnu_pbds;
| ^~~~~~~~~~
a.cc:29:9: error: 'complex' does not name a type
29 | typedef complex<ld> cd;
| ^~~~~~~
a.cc:35:9: error: 'vector' does not name a type
35 | typedef vector<int> vi;
| ^~~~~~
a.cc:36:9: error: 'vector' does not name a type
36 | typedef vector<ld> vd;
| ^~~~~~
a.cc:37:9: error: 'vector' does not name a type
37 | typedef vector<ll> vl;
| ^~~~~~
a.cc:38:9: error: 'vector' does not name a type
38 | typedef vector<pi> vpi;
| ^~~~~~
a.cc:39:9: error: 'vector' does not name a type
39 | typedef vector<pl> vpl;
| ^~~~~~
a.cc:40:9: error: 'vector' does not name a type
40 | typedef vector<cd> vcd;
| ^~~~~~
a.cc:65:1: error: 'mt19937' does not name a type
65 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
| ^~~~~~~
|
s357330834 | p03861 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for (int i=0; i < n; i++)
#define repd(i, n) for (int i = n-1; i > -1; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;
using LP = pair<ll,ll>;
using P = pair<ll,int>;
int main()
{
ll a, b, x;
cin >> a >> b>> x;
auto div = [&](ll y){
ll ret = y/x+1;
if (y < 0) ret = 0;
};
ll ans = div(b)-div(a-1);
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:18:20: error: invalid operands of types 'void' and 'void' to binary 'operator-'
18 | ll ans = div(b)-div(a-1);
| ~~~~~~^~~~~~~~~
| | |
| void void
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.