Submission #1310272
Source Code Expand
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string.h>
#include<queue>
#define LL long long
using namespace std;
inline int read( )
{
int sum=0;char c=getchar( );bool f=0;
while(c<'0'||c>'9') {if(c=='-') f=1;c=getchar( );}
while(c>='0'&&c<='9') {sum=sum*10+c-'0';c=getchar( );}
if(f) return -sum;
return sum;
}
int main( )
{
#ifndef ONLINE_JUDGE
freopen("a.in","r",stdin);
freopen("a.out","w",stdout);
#endif
LL n=read( ),a=read( ),b=read( );
if(a>b) {puts("0");return 0;}
if(n==1) {printf("%d",a==b);return 0;}
else printf("%lld",(b-a)*(n-2)+1);
return 0;
}
Submission Info
Submission Time |
|
Task |
A - A+...+B Problem |
User |
qq872191552 |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
649 Byte |
Status |
TLE |
Exec Time |
2103 ms |
Memory |
256 KB |
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:20:28: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen("a.in","r",stdin);
^
./Main.cpp:21:30: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
freopen("a.out","w",stdout);
^
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 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 |
TLE |
2103 ms |
256 KB |
02.txt |
TLE |
2103 ms |
256 KB |
03.txt |
TLE |
2103 ms |
256 KB |
04.txt |
TLE |
2103 ms |
256 KB |
05.txt |
TLE |
2103 ms |
256 KB |
06.txt |
TLE |
2103 ms |
256 KB |
07.txt |
TLE |
2103 ms |
256 KB |
08.txt |
TLE |
2103 ms |
256 KB |
s1.txt |
TLE |
2103 ms |
256 KB |
s2.txt |
TLE |
2103 ms |
256 KB |
s3.txt |
TLE |
2103 ms |
256 KB |
s4.txt |
TLE |
2103 ms |
256 KB |