submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s701517950 | p03861 | C++ | #include<bits/stdc++.h>
uing namespace std;
int main(){
long long a,b,x;
scanf("%lld%lld%lld",&a&b&x);
if(a<0)
printf("%lld",(b/x)-(a-1)/x);
else
printf("%lld",(b/x)+1;
} | a.cc:2:1: error: 'uing' does not name a type; did you mean 'uint'?
2 | uing namespace std;
| ^~~~
| uint
a.cc: In function 'int main()':
a.cc:5:32: error: invalid operands of types 'long long int*' and 'long long int' to binary 'operator&'
5 | scanf("%lld%lld%lld",&a&b&x);
| ~~^~
| | |
| | long long int
| long long int*
a.cc:9:22: error: expected ')' before ';' token
9 | printf("%lld",(b/x)+1;
| ~ ^
| )
|
s590274894 | p03861 | C++ | #include<stdio. h>
using namespace std;
int main()
{
long long a, b, x, cnt;
scanf("%lld%lld%lld", &a, &b, &x);
cnt = (b / x) - ((a - 1) / x);
if
(a==0)
++cnt ;
printf("%lld", cnt);
return 0;
} | a.cc:1:9: fatal error: stdio. h: No such file or directory
1 | #include<stdio. h>
| ^~~~~~~~~~
compilation terminated.
|
s685888631 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
int A;
int B;
char OP;
cin>>A;
cin>>OP;
cin>>B;
if(OP=="+")
cout<<A+B<<endl;
if(OP="-")
cout<<A-B;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
10 | if(OP=="+")
| ~~^~~~~
a.cc:12:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
12 | if(OP="-")
| ^~~
| |
| const char*
|
s855226461 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a;
int b;
char x;
scanf("%d%c%d",&a,&x,&b);
switch(x){
case '-':
cout<<a-b;
break;
case '+':
cout<<a+b;
break;
}
return 0;
} | a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s589892707 | p03861 | C++ | #include<stdio. h>
using namespace std;
int main()
{
long long a, b, x, cnt;
if (a<=b)
scanf("%lld%lld%lld", &a, &b, &x);
cnt = (b / x) - ((a - 1) / x);
printf("%lld", cnt);
return 0;
} | a.cc:1:9: fatal error: stdio. h: No such file or directory
1 | #include<stdio. h>
| ^~~~~~~~~~
compilation terminated.
|
s540429380 | p03861 | C | #include <iostream>
using namespace std;
int main()
{
long long a,b,x ,i=0;
cin >> a>>b>>x;
i=(b/x)-(a-1)/x;
if (a<=b)
cout << i<<endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s946760141 | p03861 | C | #include <iostream>
using namespace std;
int main()
{
long long a,b,x ,i;
cin >> a>>b>>x;
i=(b/x)-(a-1)/x;
if (a<=b)
cout << i<<endl;
return 0;
}
| main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s237103976 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
if(a>0&&b>0&&b>a&&x>0)
//scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++)
if(i%x==0)
c++;
printf("%d",c);
return 0;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s846967277 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
if(a>0&&b>0&&b>a&&x>0)
//scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++)
if(i%x==0)
c++;
printf("%d",c);
return 0;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s251943757 | p03861 | C++ | #include<bits\stdc++.h>
using namespace std;
int main(){
int a,b,x,c=0;
cin>>a>>b>>x;
if(a>0&&b>0&&b>a&&x>0)
for(int i=a;i<=b;i++)
if(i%x==0)
c++;
printf("%d",c);
return 0;
}
| a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
1 | #include<bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s489183637 | p03861 | C++ | #include<iostream>
using namespace std;
int main()
{
long long a,b,x,sum=0;
cin>>a>>b>>x;
if(x>0&&a<=b)
{
if(b%x==0)
sum=((b/x-a/x)+1;
else
sum=(b/x-a/x);
}
cout<<sum;
} | a.cc: In function 'int main()':
a.cc:10:17: error: expected ')' before ';' token
10 | sum=((b/x-a/x)+1;
| ~ ^
| )
|
s038111920 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x,ans;
cin>>a>>b>>x;
if(a==0){
ans=(b/x)+1;
}
else {
ans=(b/x)-(a-1)/x;
}
cout<<ans;
| a.cc: In function 'int main()':
a.cc:12:19: error: expected '}' at end of input
12 | cout<<ans;
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s786331704 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std ;
int main() {
long long a,b,x;int c=0;
cin>>a>>b>>x;
if (a>0&&b>=a&&x>0)
{
for(int i=a;i<=b;i++)
{
if(i%x==0)
{c++;}
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s112921024 | p03861 | C++ | #include <stdio.h >
using namespace std;
int main() {
int a, b, x,c=0;
scanf("%d %d %d",&a,&b,&x);
for (int i = a; i <= b; i++) {
if (i % x == 0)
c += 1;
}
printf("%d",c);
} | a.cc:1:10: fatal error: stdio.h : No such file or directory
1 | #include <stdio.h >
| ^~~~~~~~~~
compilation terminated.
|
s870636199 | p03861 | C++ | #include <iostream >
using namespace std;
int main() {
int a, b, x,c=0;
cin >> a >> b >> x;
for (int i = a; i <= b; i++) {
if (i % x == 0)
c += 1;
}
cout << c;
} | a.cc:1:10: fatal error: iostream : No such file or directory
1 | #include <iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s156432240 | p03861 | C++ | #include<cstring>
#include<iostream>
#include<Bits/stdc++.h>
using namespace std;
int main(){
int a,b,x,count=0;
scanf("%d%d%d",&a,&b,&x);
for(int i=0;i<1000000000000000000;i++){
if(a<0||a>b||b<a||b>1000000000000000000||x<=1||x>1000000000000000000){
printf("Wrong answer");
scanf("%d%d%d",&a,&b,&x);
}
else
for(int i=a;i<=b;i++){
if(i%x==0)
count++;
}
printf("%d",count);
break;
}
} | a.cc:3:9: fatal error: Bits/stdc++.h: No such file or directory
3 | #include<Bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s544126979 | p03861 | C++ | #include <iostream>
using namespace std;
int main() {
long long a,b,x,count=0;
cin>>a>>b>>x;
if(a==0) {
count=(b/x)+1;
}
else {
count=(b/x)-(a-1)/x;
} cout<<count;
return0;
} | a.cc: In function 'int main()':
a.cc:12:1: error: 'return0' was not declared in this scope
12 | return0;
| ^~~~~~~
|
s477938696 | p03861 | C++ | include <iostream>
using namespace std;
int main() {
long long a,b,x,count=0;
cin>>a>>b>>x;
if(a==0) {
count=(b/x)+1;
}
else {
count=(b/x)-(a-1)/x; } cout<<count; return0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:10:24: error: 'cout' was not declared in this scope; did you mean 'count'?
10 | count=(b/x)-(a-1)/x; } cout<<count; return0;
| ^~~~
| count
a.cc:10:37: error: 'return0' was not declared in this scope
10 | count=(b/x)-(a-1)/x; } cout<<count; return0;
| ^~~~~~~
|
s480648353 | p03861 | C | #include <iostream>
#include <stdio.h>
using namespace std;
int main(){
int a=0,b=0,x=0,count=0;
scanf("%d%d%d",&a,&b,&x);
for(int i=a;i<=b;i++){
if(i%x==0)
count++;
else
continue;
}
printf("%d",count);
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s528090472 | p03861 | C | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a=0,b=0,x=0,count=0;
scanf("%lld%lld%lld",&a,&b,&x);
for(long long i=a;i<=b;i++){
if(i%x==0)
count++;
else
continue;
}
printf("%lld",count);
} | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s310073182 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, x, z=0;
scanf("%d%d%d", &a, &b, &x);
if(b>=1000000000000000000 && x>=100000000000000000 ){
if (1<=x){
if(a<b){
for(int i=a;i<=b;i+=x)
z++;
printf("%d",z);
}
else if(a=b){
printf("%d",z);
}
else{
printf("Error");
}
}
else{
printf("Error");
}
}
else{
printf("Error"); | a.cc: In function 'int main()':
a.cc:27:33: error: expected '}' at end of input
27 | printf("Error");
| ^
a.cc:26:13: note: to match this '{'
26 | else{
| ^
a.cc:27:33: error: expected '}' at end of input
27 | printf("Error");
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s580544569 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
int a,b,x,count=0;
cin>>a>>b>>x;
if(a>=0&&b>=0&&x>0)
{
for(int i=a; I<=b; i++)
{
if(i%x==0){
count ++;
}
}}
count <<count;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:14: error: 'I' was not declared in this scope
9 | for(int i=a; I<=b; i++)
| ^
|
s778249650 | p03861 | C | #include <stdio.h>
using namespace std;
int main()
{
unsigned long a,b,x;
int count=0;
scanf("%lu %lu %lu",&a,&b,&x);
for(;a<=b;++a)
if(a%x==0)
count++;
printf("%d",count);
return 0;
}
| main.c:2:1: error: unknown type name 'using'
2 | using namespace std;
| ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
2 | using namespace std;
| ^~~
|
s150856133 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a, b, x;
scanf("%lld%lld%lld", &a, &b, &x);
printf("%lld", (b/x) + (a==0?1:(a-1)/x);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:40: error: expected ')' before ';' token
8 | printf("%lld", (b/x) + (a==0?1:(a-1)/x);
| ~ ^
| )
|
s118344273 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
long long a,b,x,count=0;
cin>>a>>b>>x;
if(a==0)
{ count=(b/x)+1;
}
else
{
count=(b/x)-(a-1)/x;
}
cout<<count;
return0;
} | a.cc: In function 'int main()':
a.cc:15:1: error: 'return0' was not declared in this scope
15 | return0;
| ^~~~~~~
|
s368859485 | p03861 | C++ | #include <iostream >
using namespace std;
int main() {
int a, b, x,c=0;
cin >> a >> b >> x;
for (int i = a; i <= b; i++) {
if (i % x == 0)
c += 1;
}
cout << c;
} | a.cc:1:10: fatal error: iostream : No such file or directory
1 | #include <iostream >
| ^~~~~~~~~~~
compilation terminated.
|
s725090490 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
double a,b,x;
cin>>a>>b>>x;
int count=0;
for(double i=a;i<=b;i++){
if(i%x==0) count++;
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:8:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
8 | if(i%x==0) count++;
| ~^~
| | |
| | double
| double
|
s833371431 | p03861 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin>>a>>b>>x;
int count;
for(int i=a;i<=b;i++){
if(i%x==0) count++;
}
cout<<count<<endl;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
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:10:3: error: 'cout' was not declared in this scope; did you mean 'count'?
10 | cout<<count<<endl;
| ^~~~
| count
a.cc:10:16: error: 'endl' was not declared in this scope
10 | cout<<count<<endl;
| ^~~~
|
s121561559 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,x,c=0;
cin>>a>>b>>x;int y=a,int v=b;
for(int i=y;i<=v;i++)
{
if(i%x==0)
{
c++;
}
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:22: error: expected unqualified-id before 'int'
5 | cin>>a>>b>>x;int y=a,int v=b;
| ^~~
a.cc:6:16: error: 'v' was not declared in this scope
6 | for(int i=y;i<=v;i++)
| ^
|
s052341970 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,x,c=0;
cin>>a>>b>>x;y=a,v=b;
for(int i=y;i<=v;i++)
{
if(i%x==0)
{
c++;
}
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:14: error: 'y' was not declared in this scope
5 | cin>>a>>b>>x;y=a,v=b;
| ^
a.cc:5:18: error: 'v' was not declared in this scope
5 | cin>>a>>b>>x;y=a,v=b;
| ^
|
s916186658 | p03861 | C++ | include<bits/stdc++.h>
using namespace std;
int main()
{int a,b,x,c=0;
cin>>a>>b>>x;
for(int i=a;i<=b;i++)
{
if(i%x==0)
{
C++;
}
}cout<<c;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:10:1: error: 'C' was not declared in this scope
10 | C++;
| ^
a.cc:12:2: error: 'cout' was not declared in this scope
12 | }cout<<c;
| ^~~~
|
s038454711 | p03861 | C++ | #include <iostream>
using namespace std;
int main()
{
int a , b,x,count=1;
cout <<"enter a:";
cin >>a;
cout <<"enter b:";
cin >>b;
cout <<"enter x:";
cin >>x;
while(a<b){
for(int i=a;i<=b;i++)
if (i%x=0){
count++;}
}cout<<count;
}return 0;
}
| a.cc: In function 'int main()':
a.cc:16:18: error: lvalue required as left operand of assignment
16 | if (i%x=0){
| ~^~
a.cc: At global scope:
a.cc:19:2: error: expected unqualified-id before 'return'
19 | }return 0;
| ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s624316681 | p03861 | C++ | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; } | a.cc:1:1: error: extended character is not valid in an identifier
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^
a.cc:1:1: error: stray '#' in program
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^
a.cc:1:260: error: extended character is not valid in an identifier
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^
a.cc:1:1: error: '\U0000200f' does not name a type
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
|
a.cc: In function 'int main()':
a.cc:1:95: error: 'scanf' was not declared in this scope
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^~~~~
a.cc:1:225: error: 'printf' was not declared in this scope
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
a.cc: At global scope:
a.cc:1:260: error: '\U0000200f' does not name a type
1 | #include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x;int count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
|
|
s749265749 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long int a,b,x;int count=0;
scanf("%d%d%d",&a,&b,&x);
for(a;a<=b;a++) {
if(a%x==0){
count++; }
} printf("%d",count);
return 0;
} | a.cc:1:1: error: extended character is not valid in an identifier
1 | #include<bits/stdc++.h>
| ^
a.cc:1:1: error: stray '#' in program
1 | #include<bits/stdc++.h>
| ^
a.cc:11:3: error: extended character is not valid in an identifier
11 | }
| ^
a.cc:1:1: error: '\U0000200f' does not name a type
1 | #include<bits/stdc++.h>
|
a.cc: In function 'int main()':
a.cc:5:3: error: 'scanf' was not declared in this scope
5 | scanf("%d%d%d",&a,&b,&x);
| ^~~~~
a.cc:9:17: error: 'printf' was not declared in this scope
9 | } printf("%d",count);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | #include<bits/stdc++.h>
a.cc: At global scope:
a.cc:11:3: error: '\U0000200f' does not name a type
11 | }
|
|
s323537190 | p03861 | C++ | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; } | a.cc:1:260: error: extended character is not valid in an identifier
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^
a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:1:90: error: 'scanf' was not declared in this scope
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^~~~~
a.cc:1:225: error: 'printf' was not declared in this scope
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
a.cc: At global scope:
a.cc:1:260: error: '\U0000200f' does not name a type
1 | include<bits/stdc++.h> using namespace std; int main(){ long int a,b,x,count=0; scanf("%d%d%d",&a,&b,&x); for(a;a<=b;a++) { if(a%x==0){ count++; } } printf("%d",count); return 0; }
|
|
s200318728 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,x,count=0;
scanf("%d%d%d",&a,&b,&x);
for(a;a<=b;a++) {
if(a%x==0){
count++; }
} printf("%d",count);
return 0; } | a.cc:10:12: error: extended character is not valid in an identifier
10 | return 0; }
| ^
a.cc:10:12: error: '\U0000200f' does not name a type
10 | return 0; }
|
|
s708093688 | p03861 | C++ | #include <stdio.h>
#include <iostream>
using namespace std ;
int main ( )
{
long long a , b ,x ;
scanf("%lld%lld%lld,&a,&b,&x);
if ( a%x ==0 )
cout << ((b/x) - ((a)/x) ) +1 ;
else
cout << (b/x) - ((a)/x) ;
return 0 ;
}
| a.cc:8:15: warning: missing terminating " character
8 | scanf("%lld%lld%lld,&a,&b,&x);
| ^
a.cc:8:15: error: missing terminating " character
8 | scanf("%lld%lld%lld,&a,&b,&x);
| ^~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:9: error: expected primary-expression before 'if'
11 | if ( a%x ==0 )
| ^~
a.cc:14:17: error: 'else' without a previous 'if'
14 | else
| ^~~~
|
s202934428 | p03861 | C | #include<bits/stdc++.h>
using namespace std;
int main (){
long long a,b,x,c=0;
scanf("%lld%lld%lld",&a,&b,&x);
for( a;a<=b;a++){
if(a%x==0)
c++;
}
printf("%lld",c);
} | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s445071573 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
float a;
float b;
float x;
float count=0;
scanf("%ld%ld%ld",&a,&b,&x);
for( a; a <= b ; a++){
if(a%x==0){
count++;
}
}
printf("%d",count);
}
| a.cc: In function 'int main()':
a.cc:12:14: error: invalid operands of types 'float' and 'float' to binary 'operator%'
12 | if(a%x==0){
| ~^~
| | |
| | float
| float
|
s014700849 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main (){
long long a,b,x,c=0;
scanf("%lld%lld%lld",&a,&b,&x);
for( a;a<=b;a++){
if(a%x==0)
c++;
}
printf("%lld",c); | a.cc: In function 'int main()':
a.cc:10:26: error: expected '}' at end of input
10 | printf("%lld",c);
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s089468463 | p03861 | C++ | using namespace std;
int main(){
int a;
int b;
int x;
int count=0;
scanf("%d%d%d",&a,&b,&x);
for(a;a<=b;a++){
if(a%x==0){
count++;
}
}
printf("%d",count);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:1: error: 'scanf' was not declared in this scope
8 | scanf("%d%d%d",&a,&b,&x);
| ^~~~~
a.cc:15:1: error: 'printf' was not declared in this scope
15 | printf("%d",count);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | using namespace std;
|
s054030085 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
unsigned int a,b;
int x,c=0;
scanf("%u ",&a);
scanf("%u ",&b);
scanf("%u",&x);
for(a;a<=b;a++){
if(a%x==0)
c++;
if (x!=2&&a==0&&x!=1)
c--;
}
/*if (x!=2&&(b-a)==0)
c--;*/
printf("%d",c);
| a.cc: In function 'int main()':
a.cc:21:16: error: expected '}' at end of input
21 | printf("%d",c);
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s651968947 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long a , b ;
long long x ;
scanf("%lld %lld %lld" ,&a,&b,&x);
sum+=(b/x) - ((a)/x);
if(a%x == 0)
++sum;
printf("%lld\n",sum);
}
| a.cc: In function 'int main()':
a.cc:9:9: error: 'sum' was not declared in this scope
9 | sum+=(b/x) - ((a)/x);
| ^~~
|
s342363907 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
long long a , b ;
long long x ;
scanf("%lld %lld %lld" ,&a,&b,&x);
a--;
sum+=(b/x) - ((a)/x);
if(a%x == 0)
++sum;
printf("%lld\n",sum);
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'sum' was not declared in this scope
10 | sum+=(b/x) - ((a)/x);
| ^~~
|
s836493486 | p03861 | C++ |
using namespace std;
int main (){
int n,a;
scanf("%d%d",&a,&n);
if(1<=a<=n){
a=a-n;}
if(a%2==0)
cout<<"A";
else
cout<<"M";
| a.cc: In function 'int main()':
a.cc:6:1: error: 'scanf' was not declared in this scope
6 | scanf("%d%d",&a,&n);
| ^~~~~
a.cc:10:1: error: 'cout' was not declared in this scope
10 | cout<<"A";
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:12:1: error: 'cout' was not declared in this scope
12 | cout<<"M";
| ^~~~
a.cc:12:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:11: error: expected '}' at end of input
12 | cout<<"M";
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s946812531 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
int sum=0;
long long a,b,x;
cin>>a>>b>>c;
for(int i=a;i<=b;i++){
if(i%x==0){
sum++;
}
}
cout<<sum;
} | a.cc: In function 'int main()':
a.cc:6:12: error: 'c' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
|
s239615280 | p03861 | C++ | #include<iostream>
using namespace std;
int main(){
double a,b,x,count=0,y;
cin>>a>>b>>x;
if(a>=0&&b>=0&&x>=0)
for(int i=a;i<=b;i++){
if(i%x==0)
count++;
}
cout<<count<<endl;
} | a.cc: In function 'int main()':
a.cc:8:21: error: invalid operands of types 'int' and 'double' to binary 'operator%'
8 | if(i%x==0)
| ~^~
| | |
| | double
| int
|
s406806391 | p03861 | C++ | #include <bits/stdc++>
using namespace std ;
int main ( )
{
int a , b , x ;
int counter = 0 ;
scanf("%d%d%d" ,&a,&b,&x);
for ( int i = a ; i <= b ; i++)
{
if ( i%x ==0)
counter ++ ;
}
printf ("%d", counter) ;
return 0 ;
}
| a.cc:1:10: fatal error: bits/stdc++: No such file or directory
1 | #include <bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s596230517 | p03861 | C | #include <bits/stdc++.h>
using namespace std ;
int main ( )
{
int a , b , x ;
int counter = 0 ;
scanf("%d%d%d" ,&a,&b,&x);
for ( int i = a ; i <= b ; i++)
{
if ( i%x ==0)
counter ++ ;
}
printf ("%d", counter) ;
return 0 ;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s695409608 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int a,b,x;
cin>>a>>b>>x;
if(a!=0){
long long int A=(a-1)/x;
}
else{
long long int A=0;
}
long long int B=b/x;
long long int ans=B-A;
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:15:23: error: 'A' was not declared in this scope
15 | long long int ans=B-A;
| ^
|
s942123690 | p03861 | C++ | /*
#include<rabbit>;
using blueHulkStress;
using AceOfSpades;
*/
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = (1e-9);
typedef long long ll;
typedef unsigned long long ull;
#define flush fflush(stdout), cout.flush()
#define all(v) ((v).begin()),((v).end())
#define rall(v) ((v).rbegin()),((v).rend())
#define clr(v,line) memset(v,line,sizeof(v))
#define rep(i,n) for(int(i)=0;(i)<(int)(n);(i)++)
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define lcm(a,b) (a*(b/__gcd(a,b)))
#define P 1000000007
#define endl '\n'
const int dx[] = {1,-1,0,0,1,-1,1,-1};
const int dy[] = {0,0,1,-1,1,-1,-1,1};
const int dxhorse[] = {-2,-2,-1,-1,1,1,2,2};
const int dyhorse[] = {1,-1,2,-2,2,-2,1,-1};
void fast()
{
std::ios_base::sync_with_stdio(0);
cin.tie(NULL); cout.tie(NULL);
}
int main(int argc, char const *argv[])
{
ull a,b,x;cin>>a>>b>>x;
cout<<b / x - max((a-1) / x , 0);
} | a.cc: In function 'int main(int, const char**)':
a.cc:42:26: error: no matching function for call to 'max(ull, int)'
42 | cout<<b / x - max((a-1) / x , 0);
| ~~~^~~~~~~~~~~~~~~
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:6:
/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:42:26: note: deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'int')
42 | cout<<b / x - max((a-1) / x , 0);
| ~~~^~~~~~~~~~~~~~~
/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:42:26: note: mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
42 | cout<<b / x - max((a-1) / x , 0);
| ~~~^~~~~~~~~~~~~~~
|
s660861055 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long a,b,x;
cin>>a>>b>>x;
cout<<a%x?b/x-a/x:b/x-a/x+1<<endl;
} | a.cc: In function 'int main()':
a.cc:6:36: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
6 | cout<<a%x?b/x-a/x:b/x-a/x+1<<endl;
| ~~~~~~~~~^~~~~~
|
s272933828 | p03861 | C++ | #include<cstdio>
def long long ll;
int main(){
ll a, b, x;
scanf("%lld %lld %lld", &a, &b, &x);
ll n = 0;
for(a; a<=b; a++){
if(a%x==0)
n++;
}
printf("%lld", n);
return 0;
}
| a.cc:2:1: error: 'def' does not name a type
2 | def long long ll;
| ^~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll a, b, x;
| ^~
a.cc:5:28: error: 'a' was not declared in this scope
5 | scanf("%lld %lld %lld", &a, &b, &x);
| ^
a.cc:5:32: error: 'b' was not declared in this scope
5 | scanf("%lld %lld %lld", &a, &b, &x);
| ^
a.cc:5:36: error: 'x' was not declared in this scope
5 | scanf("%lld %lld %lld", &a, &b, &x);
| ^
a.cc:7:5: error: expected ';' before 'n'
7 | ll n = 0;
| ^~
| ;
a.cc:10:7: error: 'n' was not declared in this scope
10 | n++;
| ^
a.cc:12:18: error: 'n' was not declared in this scope
12 | printf("%lld", n);
| ^
|
s315776125 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
int a, b, x;
cin >> a >> b >> x;
if(a==b)
res =0;
else{
int res = b/x - a/x +1;}
cout << res << endl;
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'res' was not declared in this scope
8 | res =0;
| ^~~
a.cc:11:11: error: 'res' was not declared in this scope
11 | cout << res << endl;
| ^~~
|
s584009735 | p03861 | C++ | #include <iostream>
using namespce std;
int main(){
int a, b, x;
cin >> a >> b >> x;
int res = b/x - a/x +1;
cout << res << endl;
}
| a.cc:2:7: error: expected nested-name-specifier before 'namespce'
2 | using namespce std;
| ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin >> a >> b >> x;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout << res << 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:8:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
8 | cout << res << 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)
| ^~~~
|
s506736664 | p03861 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long ll;
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll Mypow(ll x, ll k){
ll res = 1;
while(k > 0){
if(k % 2) res *= x;
x *= x;
k /= 2;
}
return res;
}
ll gcd(ll a, ll b){//計算量はO(log(max(a,b))
if(b == 0) return a;
return gcd(b, a % b);
}
ll INFL = 1LL << 60;//10^18 = 2^60
int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};
ll kai(ll x){
if(x == 1) return 1;
return x * kai(x-1) % MOD;
}
int main(){
ll a, b, x; cin >> a >> b >> x;
if(a == 0){
cout << 1 + b / x << endl;
return 0;
}
cout << b / x - (a-1) / x << endl;
cout << lower_bound(A.begin(), A.end(), K) << endl;
cout << upper_bound()
}
| a.cc: In function 'int main()':
a.cc:134:23: error: 'A' was not declared in this scope
134 | cout << lower_bound(A.begin(), A.end(), K) << endl;
| ^
a.cc:134:43: error: 'K' was not declared in this scope
134 | cout << lower_bound(A.begin(), A.end(), K) << endl;
| ^
a.cc:135:22: error: no matching function for call to 'upper_bound()'
135 | cout << upper_bound()
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:32:
/usr/include/c++/14/bits/stl_algo.h:2019:5: note: candidate: 'template<class _FIter, class _Tp> _FIter std::upper_bound(_FIter, _FIter, const _Tp&)'
2019 | upper_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2019:5: note: candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_algo.h:2050:5: note: candidate: 'template<class _FIter, class _Tp, class _Compare> _FIter std::upper_bound(_FIter, _FIter, const _Tp&, _Compare)'
2050 | upper_bound(_ForwardIterator __first, _ForwardIterator __last,
| ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2050:5: note: candidate expects 4 arguments, 0 provided
|
s586723262 | p03861 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
typedef long long ll;
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll Mypow(ll x, ll k){
ll res = 1;
while(k > 0){
if(k % 2) res *= x;
x *= x;
k /= 2;
}
return res;
}
ll gcd(ll a, ll b){//計算量はO(log(max(a,b))
if(b == 0) return a;
return gcd(b, a % b);
}
ll INFL = 1LL << 60;//10^18 = 2^60
int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};
ll kai(ll x){
if(x == 1) return 1;
return x * kai(x-1) % MOD;
}
int main(){
ll a, b, x; cin >> a >> b >> x;
if(a == 0){
cout << b / x << endl:
return 0;
}
cout << b / x - (a-1) / x << endl;
}
| a.cc: In function 'int main()':
a.cc:130:26: error: expected ';' before ':' token
130 | cout << b / x << endl:
| ^
| ;
|
s550621111 | p03861 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
int main()
{
ll a, b, x;
cin >> a >> b >> x;
cout << ((b / x + 1) - max((a - 1) / x + 1, 0)) << endl;
} | a.cc: In function 'int main()':
a.cc:14:31: error: no matching function for call to 'max(ll, int)'
14 | cout << ((b / x + 1) - max((a - 1) / x + 1, 0)) << endl;
| ~~~^~~~~~~~~~~~~~~~~~~~
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:14:31: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
14 | cout << ((b / x + 1) - max((a - 1) / x + 1, 0)) << 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
|
s390855944 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long a,b,X,x,y,ans,g;
cin>>a>>b>>X;
ans=0;
x=N%2+M%2+X%2;
ans=b/X-(a-1)/X;
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:8:5: error: 'N' was not declared in this scope
8 | x=N%2+M%2+X%2;
| ^
a.cc:8:9: error: 'M' was not declared in this scope
8 | x=N%2+M%2+X%2;
| ^
|
s361421385 | p03861 | Java |
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
long a = s.nextLong();
long b = s.nextLong();
long x = s.nextLong();
long answer = 0;
if ((b - a) < x) {
if (a == b) {
if (a % x != 0) {
answer = 0;
} else if (a % x == 0) {
answer = 1;
}
} else if (b % 2 == 0) {
answer = 1;
} else if (b % 2 != 0) {
answer = 1;
}
} else if ((b - a) > x) {
if (a == b) {
if (a % x != 0) {
answer = 0;
} else if (a % x == 0) {
answer = 1;
}
} else if (a == 0) {
answer = (b / x) + 1;
} else {
if ((b - a) % 2 == 0) {
if ((b - a) % x == 0) {
answer = (b - a) / x + 1;
} else if ((b - a) % x != 0) {
answer = (b - a) / x;
}
} else if ((b - a) % 2 != 0) {
if ((b - a) % x == 0) {
answer = (b - a) / x;
} else if ((b - a) % x != 0) {
answer = (b - a) / x + 1;
}
}
}
}
System.out.println(answer);
}
} | Main.java:5: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:5: error: cannot find symbol
Scanner s = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s493484854 | p03861 | C++ | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>
using namespace std;
#define ll long long
#define P pair<int, int>
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define GI(name) \
int(name); \
scanf("%d", &(name))
#define GI2(name1, name2) \
int(name1), (name2); \
scanf("%d %d", &(name1), &(name2))
#define GI3(name1, name2, name3) \
int(name1), (name2), (name3); \
scanf("%d %d %d", &(name1), &(name2), &(name3))
#define GVI(name, size) \
vector<int>(name)(size); \
FOR(i, (size)) scanf("%d", &(name)[i])
#define GS(name) \
string(name); \
cin >> (name);
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)
string to_string(string s) {
return s;
}
template <class T>
string to_string(vector<T> v) {
string ret = "{";
FOR(i, v.size() - 1) { ret += to_string(v[i]) + ","; }
if (v.size() > 0) {
ret += to_string(v.back());
}
ret += "}";
return ret;
}
void debug() {
cerr << endl;
}
template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
cerr << to_string(head) << " ";
debug(tail...);
}
void print() {
cout << endl;
}
template <class Head, class... Tail>
void print(Head head, Tail... tail) {
cout << to_string(head);
print(tail...);
}
int main() {
ll a, b, x;
cin >> a >> b >> x;
ll n1 = (a - 1) / x, n2 = b / x;
print(max(0, n2 - n1));
return 0;
} | a.cc: In function 'int main()':
a.cc:78:12: error: no matching function for call to 'max(int, long long int)'
78 | print(max(0, n2 - n1));
| ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
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:78:12: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
78 | print(max(0, n2 - n1));
| ~~~^~~~~~~~~~~~
/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:78:12: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
78 | print(max(0, n2 - n1));
| ~~~^~~~~~~~~~~~
|
s233339884 | p03861 | C++ | #include "1_07.txt" | a.cc:1:10: fatal error: 1_07.txt: No such file or directory
1 | #include "1_07.txt"
| ^~~~~~~~~~
compilation terminated.
|
s894218705 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t a,b,x,count;
cin >> a >> b >> x;
count =0;
for(,a<=b;a++){
if(a%x==0) count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:8:7: error: expected primary-expression before ',' token
8 | for(,a<=b;a++){
| ^
a.cc:8:16: error: expected ';' before ')' token
8 | for(,a<=b;a++){
| ^
| ;
|
s087511151 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int_64t a,b,x,count;
cin >> a >> b >> x;
count =0;
for(,a<=b;a++){
if(a%x==0) count++;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:5:2: error: 'int_64t' was not declared in this scope; did you mean 'int64_t'?
5 | int_64t a,b,x,count;
| ^~~~~~~
| int64_t
a.cc:6:10: error: 'a' was not declared in this scope
6 | cin >> a >> b >> x;
| ^
a.cc:6:15: 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:10: error: overloaded function with no contextual type information
7 | count =0;
| ^
a.cc:8:7: error: expected primary-expression before ',' token
8 | for(,a<=b;a++){
| ^
a.cc:8:16: error: expected ';' before ')' token
8 | for(,a<=b;a++){
| ^
| ;
a.cc:9:25: error: no post-increment operator for type
9 | if(a%x==0) count++;
| ^~
a.cc:11:8: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
11 | cout << count << endl;
| ~~~~~^~~~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
24 |
s781656668 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void)
{
long long int a,b,x;
cin>>a>>b>>x;
long long int c=(b/x)-(a/x);
if(a%x==0&&b%==0)
cout<<c+1<<endl;
else
cout<<c<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:17: error: expected primary-expression before '=' token
9 | if(a%x==0&&b%==0)
| ^
|
s757912044 | p03861 | C++ | #include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;
using namespace std;
template <typename T> void output(T, int);
int gcd(int a, int b);
int main() {
// source
ll a, b, x;
cin >> a >> b >> x;
ll ans = b / x - (a - 1) / x;
ans = max(ans, 0);
cout << ans << endl;
return 0;
}
template <typename T> void output(T a, int precision) {
if (precision > 0) {
cout << setprecision(precision) << a << "\n";
} else {
cout << a << "\n";
}
}
template <typename T> T min(T a, T b) {
if (a < b) {
return a;
} else {
return b;
}
}
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
| a.cc: In function 'int main()':
a.cc:29:14: error: no matching function for call to 'max(ll&, int)'
29 | ans = max(ans, 0);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
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:29:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
29 | ans = max(ans, 0);
| ~~~^~~~~~~~
/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:29:14: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
29 | ans = max(ans, 0);
| ~~~^~~~~~~~
|
s630531446 | p03861 | C++ | #include <bits/stdc++.h>
#define i64 long long
using namespace std;
int main() {
// your code goes here
i64 a,b,x;
cin>>a>>b>>x;
if(b<a) swap(a,b);
printf("%lld\n", b/x - (max(0,a-1))/x);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:36: error: no matching function for call to 'max(int, long long int)'
9 | printf("%lld\n", b/x - (max(0,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: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:9:36: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
9 | printf("%lld\n", 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
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:9:36: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
9 | printf("%lld\n", b/x - (max(0,a-1))/x);
| ~~~^~~~~~~
|
s688779007 | p03861 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextInt();
long b = sc.nextInt();
int x = sc.nextInt();
int cnt = 0;
for(int i=a; i <= b; i++) {
if(i % x == 0) {
cnt++;
}
}
System.out.println(cnt);
}
} | Main.java:10: error: incompatible types: possible lossy conversion from long to int
for(int i=a; i <= b; i++) {
^
1 error
|
s682477267 | p03861 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int x = sc.nextInt();
int cnt = 0;
for(int i=a; i <= b; i++) {
if(i % x == 0) {
cnt++;
}
}
System.out.println(cnt);
}
| Main.java:16: error: reached end of file while parsing
}
^
1 error
|
s561334515 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
unsigned long long a,b,x;
cin>>a>>b>>x;
if(a%x=0){cout<<b/x+1-a/x;}
else{cout<<b/x-a/x;}
} | a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
6 | if(a%x=0){cout<<b/x+1-a/x;}
| ~^~
|
s602515178 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long a,b,x;
cin>>a>>b>>x;
long ans=0;
cout<<b/x-max(0,(a-1)/x);
} | a.cc: In function 'int main()':
a.cc:7:16: error: no matching function for call to 'max(int, long long int)'
7 | cout<<b/x-max(0,(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: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:7:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | cout<<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
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:7:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout<<b/x-max(0,(a-1)/x);
| ~~~^~~~~~~~~~~
|
s621650629 | p03861 | C++ | #include<bits/stdc++.h>
long long a,b,x;
long long s,e;
int main(){
cin>>a>>b>>x;
if(a%x==0)s=a/x;
else s=a/x+1;
e=b/x;
cout<<e-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b>>x;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<e-s+1<<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:9:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<e-s+1<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s727156422 | p03861 | C++ | #include<cstdio>
long long a,b,x;
long long s,e;
int main(){
cin>>a>>b>>x;
if(a%x==0)s=a/x;
else s=a/x+1;
e=b/x;
cout<<e-s+1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin>>a>>b>>x;
| ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
9 | cout<<e-s+1<<endl;
| ^~~~
a.cc:9:18: error: 'endl' was not declared in this scope
9 | cout<<e-s+1<<endl;
| ^~~~
|
s472839536 | p03861 | C++ | #include <iostream>
typedef long long int ll;
using namespace std;
int main() {
ll a, b, x;
cin >> a >> b >> x;
ll a_num=0, b_num;
if(a == b) cout << if(a%x == 0) << endl;
else if(x == 1 && a == 1) a_num = 2;
else if(a != 1) {
a--;
a_num = a/x;
}
b_num = b/x;
cout << b_num - a_num << endl;
// if(b - a == 0) cout << 0 << endl;
// else cout << (b - a + 1)/x << endl;
}
| a.cc: In function 'int main()':
a.cc:10:22: error: expected primary-expression before 'if'
10 | if(a == b) cout << if(a%x == 0) << endl;
| ^~
|
s877299277 | p03861 | C++ | #include<iostream>↲
#include<stdio.h>↲
#include<string>↲
#include <math.h>↲
using namespace std;↲
# define maxn 200000-↲
↲
int main(){↲
long long a,b,x,cnt(0);↲
cin>>a>>b>>x;↲
cout<<(b/x)-(a/x);↲
// int n,a[maxn],b[maxn],cnt(0),sum(0);↲
// cin>>n;↲
// for(int i(0);i<n;i++){↲
// cin>>a[i]>>b[i];↲
// }↲
// for(int i(0);i<n;i++){↲
// if(a[i]==b[i]){↲
// cout << -1<<endl;↲
// }else{↲
// cout << abs(a[i] - b[i])<<endl;↲
// }↲
// }↲
return 0;↲
}↲
| a.cc:1:9: error: extended character ↲ is not valid in an identifier
1 | #include<iostream>↲
| ^
a.cc:1:9: fatal error: iostream>��: No such file or directory
1 | #include<iostream>↲
| ^~~~~~~~~~~
compilation terminated.
|
s115610646 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a, b, x;
cin >> a >> b >> x;
int count;
if (a !== 0){
count = (b - a + 1 )/ x;
}
else {
count = b / x;
}
cout << count << endl;
} | a.cc: In function 'int main()':
a.cc:8:13: error: expected primary-expression before '=' token
8 | if (a !== 0){
| ^
|
s439790271 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
long long int A,B,C;
int D=0;
cin >>A>>B>>C;
for(int i=A;i<=B;i++){
if(i==0) contiune;
if(i%C==0)D++;
}
cout << D;
} | a.cc: In function 'int main()':
a.cc:9:16: error: 'contiune' was not declared in this scope
9 | if(i==0) contiune;
| ^~~~~~~~
|
s605247008 | p03861 | C++ | #include <iostream>
using namespace std;
int main(){
unsigned long long int A,B,C,D=0;
cin >>A>>B>>C;
for(int i=A,i<=B;i++){
if(B%A==0)D++;
}
cout << D;
} | a.cc: In function 'int main()':
a.cc:7:22: error: expected ';' before '<=' token
7 | for(int i=A,i<=B;i++){
| ^~
| ;
a.cc:7:22: error: expected primary-expression before '<=' token
7 | for(int i=A,i<=B;i++){
| ^~
|
s600096303 | p03861 | C | #include <stdio.h>
int main(){
long long int a,b,x;
scanf("%lld %lld %lld", &a, &b, &x);
long long int ans = (b+x)/x-(a+-1x)/x;
printf("%lld\n", ans);
return 0;
} | main.c: In function 'main':
main.c:6:37: error: invalid suffix "x" on integer constant
6 | long long int ans = (b+x)/x-(a+-1x)/x;
| ^~
|
s286934027 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
cout.tie(0), cin.tie(0), ios::sync_with_stdio(0);
int a, b, x;
cin >> a >> b >> x;
a--;
a = max(0, a);
cout << b / x - a / x;
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:16: error: no matching function for call to 'max(int, long long int&)'
14 | a = max(0, a);
| ~~~^~~~~~
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:14:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
14 | a = max(0, a);
| ~~~^~~~~~
/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:14:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
14 | a = max(0, a);
| ~~~^~~~~~
|
s049127091 | p03861 | C++ | #include<iostream>
using namespace std;
#define ll long long
int main()
{
ll a,b,x,y,z;
cin>>a>>b>>x;
y=a/x;
if(a%x!=0)y++;
z=b/x;
cout<<z-y+1;
return 0;
}
long long e=d/n-c/n+1;
if(e<=a||e<=b)
cout<<e;
return 0;
} | a.cc:14:21: error: 'd' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:23: error: 'n' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:25: error: 'c' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:27: error: 'n' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:15:9: error: expected unqualified-id before 'if'
15 | if(e<=a||e<=b)
| ^~
a.cc:17:9: error: expected unqualified-id before 'return'
17 | return 0;
| ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s759776377 | p03861 | C++ | #include<iostream>
using namespace std;
#define ll long long
int main()
{
ll a,b,x,y,z;
cin>>a>>b>>x;
y=a/x;
if(a%x!==0)y++;
z=b/x;
cout<<z-y+1;
return 0;
}
long long e=d/n-c/n+1;
if(e<=a||e<=b)
cout<<e;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:17: error: expected primary-expression before '=' token
9 | if(a%x!==0)y++;
| ^
a.cc: At global scope:
a.cc:14:21: error: 'd' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:23: error: 'n' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:25: error: 'c' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:14:27: error: 'n' was not declared in this scope
14 | long long e=d/n-c/n+1;
| ^
a.cc:15:9: error: expected unqualified-id before 'if'
15 | if(e<=a||e<=b)
| ^~
a.cc:17:9: error: expected unqualified-id before 'return'
17 | return 0;
| ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
18 | }
| ^
|
s932199341 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
double a,b,x;
cin >> a >> b >> x;
int sum=0;
for(double i=a;i<=b;i++){
if(i%x==0){
sum+=1;
}
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:8:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
8 | if(i%x==0){
| ~^~
| | |
| | double
| double
|
s131330694 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >> x;
int sum=0;
for(int i=a;i=<b;i++){
if(i%x==0){
sum++;
}
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before '<' token
7 | for(int i=a;i=<b;i++){
| ^
|
s426082980 | p03861 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,x;
cin >> a >> b >> x;
int sum=0;
for(i=a;i=<b;i++){
if(i%x==0){
sum++;
}
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
7 | for(i=a;i=<b;i++){
| ^
a.cc:7:13: error: expected primary-expression before '<' token
7 | for(i=a;i=<b;i++){
| ^
|
s257309331 | p03861 | Java | package com.javalesson.chapter1.task0;
import java.util.*;
/**
* Создайте программу, которая будет принимать две группы параметров:
* - количество циклов выполнения программы;
* - 3 числа a, b, n
* и выводить на экран последовательность результатов вычисления следующего выражения
* (a + 2^0*b),(a + 2^0*b + 2^1*b),(a + 2^0*b + 2^1*b + 2^2*b)..., (a+2^0*b + 2^1*b + 2^2*b +...+ 2^(n-1)*b)
* где ^ обозначает возведение в степень, и эта операция выполняется до умножения.
* <p>
* Пример:
* Please enter the number of iterations
* 2
* Enter the group of 3 numbers
* 0 2 10
* Output:
* 2 6 14 30 62 126 254 510 1022 2046
* Enter the group of 3 numbers
* 5 3 5
* Output:
* 8 14 26 50 98
* <p>
* Пример:
* a=5, b=3, n=5
* (5+2^0*3)=8,(5+2^0*3 + 2^1*3)=14,(5+2^0*3 + 2^1*3 + 2^2*3)=26,(5+2^0*3 + 2^1*3 + 2^2*3 + 2^3*3)=50,
* (5+2^0*3 + 2^1*3 + 2^2*3 + 2^3*3 + 2^4*3)=98
*/
public class LoopTask {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long a, b, x;
a = in.nextLong();
b = in.nextLong();
x = in.nextLong();
if (a == 0) {
System.out.println(b / x + 1);
} else {
System.out.println((b / x) - (a - 1) / x);
}
}
}
| Main.java:31: error: class LoopTask is public, should be declared in a file named LoopTask.java
public class LoopTask {
^
1 error
|
s034357455 | p03861 | C++ | #include <stdio.h>
int main(void){
double a,b,x,c=0;
int i;
scanf("%f %f %f",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%b==0)
c++;
}
printf("%d",c);
}
| a.cc: In function 'int main()':
a.cc:7:13: error: invalid operands of types 'int' and 'double' to binary 'operator%'
7 | if(i%b==0)
| ~^~
| | |
| | double
| int
|
s659755796 | p03861 | C++ | #include <stdio.h>
int main(void){
double a,b,x,c=0;
int i;
scanf("%ld %ld %ld",&a,&b,&x);
for(i=a;i<=b;i++){
if(i%b==0)
c++;
}
printf("%d",c);
} | a.cc: In function 'int main()':
a.cc:7:13: error: invalid operands of types 'int' and 'double' to binary 'operator%'
7 | if(i%b==0)
| ~^~
| | |
| | double
| int
|
s938949176 | p03861 | C++ | #include <iostream>
using namespace std;
const long long MAX_NUM = 999999999999;
int main() {
long long a, b, x;
cin >> a >> b >> x;
long long ans = 0;
if (x <= a) {
for (long long i = 2; i <= MAX_NUM; ++i) {
long long num = x* i;
if (num >= a){
ans += ((b - num) / x + 1);
break;
}
}
}
else {
if (x <= b) {
if (a == 0){
ans += ((b - x) / x + 2);
}
else {
ans += ((b - x) / x + 1);
}
}
cout << ans << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
28 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s576525321 | p03861 | C++ | #include <iostream>
using namespace std;
const int MAX_ITER = 999999999;
int main() {
long long a, b, x;
cin >> a >> b >> x;
long long ans = 0;
for (long long i = a; i <= b; ++i) {
if (!(i % x)) {
flag = true;
++ans;
long long nowNum = i;
for (int j = 0; j < MAX_ITER; ++j) {
nowNum += x;
if (nowNum <= b) {
++ans;
}
else {
cout << ans << "\n";
return 0;
}
}
}
}
cout << ans << "\n";
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:7: error: 'flag' was not declared in this scope
11 | flag = true;
| ^~~~
|
s079030620 | p03861 | C++ | #include <iostream>
using namespace std;
const int MAX_ITER = 999999999;
int main() {
long long a, b, x;
cin >> a >> b >> x;
bool flag = false;
long long ans = 0;
for (long long i = a; i < b; ++i) {
if (!(i % x)) {
flag = true;
++ans;
long long nowNum = i;
for (int j = 0; j < MAX_ITER; ++j) {
nowNum *= i;
if (nuwNum < b) {
++ans;
}
else {
break;
}
}
}
if (flag) {
break;
}
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:17:13: error: 'nuwNum' was not declared in this scope; did you mean 'nowNum'?
17 | if (nuwNum < b) {
| ^~~~~~
| nowNum
|
s159013763 | p03861 | C++ | #include <iostream>
using namespace std;
const int MAX_ITER = 999999999;
int main() {
long long a, b, x;
cin >> a >> b >> x;
bool flag = false;
long long ans = 0;
for (long long i = a; i < b; ++i) {
if (!(i % x)) {
flag = true;
++ans;
long long nowNum = i;
for (int j = 0; j < MAX_ITER; ++j) {
nowNum *= i
if (nuwNum < b) {
++ans;
}
else {
break;
}
}
}
if (flag) {
break;
}
}
cout << ans << "\n";
}
| a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before 'if'
16 | nowNum *= i
| ^
| ;
17 | if (nuwNum < b) {
| ~~
a.cc:20:9: error: 'else' without a previous 'if'
20 | else {
| ^~~~
|
s875791095 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(void){
long long a,b,x,ans;
cin >> a >> b >> x;
if(xa==0){
ans = b/x;
}else{
ans = (b/x)-(a-1)/x;
}
cout << ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:12: error: 'xa' was not declared in this scope; did you mean 'x'?
7 | if(xa==0){
| ^~
| x
|
s081667965 | p03861 | C++ | #include <cstdio>
using namespace std;
int main() {
long long a, b, x;
scanf("%lld %lld %lld", &a, &b, &x);
if (a == 0)
printf("%lld", b/x+1);
else
printf("%lld", b/x - (a-1))/x);
}
| a.cc: In function 'int main()':
a.cc:12:38: error: expected ';' before ')' token
12 | printf("%lld", b/x - (a-1))/x);
| ^
| ;
|
s514627523 | p03861 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
long long a, b, x;
scanf("%lld %lld %lld", &a, &b, &x);
printf("%lld", b/x - max(0, (a-1))/x);
}
| a.cc: In function 'int main()':
a.cc:10:29: error: no matching function for call to 'max(int, long long int)'
10 | printf("%lld", b/x - max(0, (a-1))/x);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/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:29: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
10 | printf("%lld", 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
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:10:29: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
10 | printf("%lld", b/x - max(0, (a-1))/x);
| ~~~^~~~~~~~~~
|
s705332507 | p03861 | C++ | #include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
long long a, b, x, res;
scanf("%lld %lld %lld", &a, &b, &x);
res = (b / x) - (max(0, (a - 1)) / x);
cout << res << '\n';
return 0;
} | a.cc: In function 'int main()':
a.cc:10:25: error: no matching function for call to 'max(int, long long int)'
10 | res = (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:2:
/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:25: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
10 | res = (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
|
s366324623 | p03861 | C++ | #include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
long long a, b, x, res;
scanf("%lld %lld %lld", &a, &b, &x);
res = (b / x) - ((a - 1) / x);
cout << res << '\n';
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:5: error: 'cout' was not declared in this scope
10 | cout << res << '\n';
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<math.h>
+++ |+#include <iostream>
3 | using namespace std;
|
s965267760 | p03861 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long x = sc.nextInt();
long count = 0;
if (a == 0 && b == 0) {
count++;
} (a == 0) {
count = (b / x) + (a / x);
count++;
} else {
count = (b / x) - ((a - 1) / x);
}
System.out.println(count);
}
}
| Main.java:12: error: not a statement
} (a == 0) {
^
Main.java:12: error: ';' expected
} (a == 0) {
^
Main.java:15: error: 'else' without 'if'
} else {
^
3 errors
|
s661930162 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a, b, x;
cin >> a >> b >> x;
if(a == 0{
cout << b/x - a/x + 1;
}else{
cout << b/x - a/x;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:14: error: expected ';' before '{' token
7 | if(a == 0{
| ^
| ;
a.cc:9:6: error: expected primary-expression before 'else'
9 | }else{
| ^~~~
a.cc:9:6: error: expected ')' before 'else'
9 | }else{
| ^~~~
| )
a.cc:7:7: note: to match this '('
7 | if(a == 0{
| ^
|
s298754813 | p03861 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long a, b, x;
cin >> a >> b >> x;
cout << b/x - max(0, a-1)/x;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:22: error: no matching function for call to 'max(int, long long int)'
7 | cout << b/x - max(0, 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: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:7:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
7 | cout << 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
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:7:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
7 | cout << b/x - max(0, a-1)/x;
| ~~~^~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.