Submission #3235689
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2
// }}} 1
int main() {
ll n,a,b;
Scll3(n,a,b);
if( a > b ){
printf ("%d\n", 0);
return 0;
}
if( n == 1 ){
if( a == b ){
printf ("%d\n", 1);
return 0;
}else{
printf ("%d\n", 0);
return 0;
}
}
n -= 2;
ll ans = n*b - n*a + 1;
printf ("%llu\n", ans);
return 0;
}
Submission Info
Submission Time
2018-09-21 20:07:14+0900
Task
A - A+...+B Problem
User
nishionyama
Language
C++14 (GCC 5.4.1)
Score
200
Code Size
1227 Byte
Status
AC
Exec Time
1 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:42:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
Scll3(n,a,b);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
200 / 200
Status
Set Name
Test Cases
Sample
s1.txt, s2.txt, s3.txt, s4.txt
All
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt, s3.txt, s4.txt
Case Name
Status
Exec Time
Memory
01.txt
AC
1 ms
256 KB
02.txt
AC
1 ms
256 KB
03.txt
AC
1 ms
256 KB
04.txt
AC
1 ms
256 KB
05.txt
AC
1 ms
256 KB
06.txt
AC
1 ms
256 KB
07.txt
AC
1 ms
256 KB
08.txt
AC
1 ms
256 KB
s1.txt
AC
1 ms
256 KB
s2.txt
AC
1 ms
256 KB
s3.txt
AC
1 ms
256 KB
s4.txt
AC
1 ms
256 KB