Submission #10518137


Source Code Expand

#include<bits/stdc++.h>
#define sr register short
#define su unsigned short
#define r register int
#define u unsigned int
#define ll long long
#define llr register long long
#define llu unsigned long long
#define lf double
#define Lf long double
using namespace std;
int main()
{
/*#ifndef ONLINE_JUDGE 
    freopen("cpp.in","r",stdin); 
#endif*/
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    ll n,a,b;
    scanf("%lld%lld%lld",&n,&a,&b);
    printf("%lld",max(0,(n-2)*(b-a)+1));
    puts("");
    return 0;
}

Submission Info

Submission Time
Task A - A+...+B Problem
User luogu_bot2
Language C++ (GCC 5.4.1)
Score 0
Code Size 533 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:21:38: error: no matching function for call to ‘max(int, long long int)’
     printf("%lld",max(0,(n-2)*(b-a)+1));
                                      ^
In file included from /usr/include/c++/5/algorithm:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
                 from ./Main.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^
/usr/include/c++/5/bits/stl_algobase.h:219:5: note:   template argument deduction/substitution failed:
./Main.cpp:21:38: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
     printf("%lld",max(0,(n-2)*(b-a)+1));
                                      ^
In file included from /usr/include/c++/5/algorithm:61:0,
                 from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:64,
                 from ./Main.cpp:1:
/usr/include/c++...