Submission #2549442
Source Code Expand
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define scd(x) scanf("%lf",&x)
#define scc(x) scanf("%[^\n]s",x); // For charecter string input , It will read all charecter untill Enter new line .
#define pfi(x) printf("%d",x)
#define pfl(x) printf("%lld",x)
#define pfd(x) printf("%lf",x)
#define pfc(x) printf("Case %d: ",x)
#define ps printf(" ")
#define pn printf("\n")
#define pb(x) push_back(x)
#define ppb(x) pop_back(x)
#define pf(x) push_front(x)
#define ppf(x) pop_front(x)
#define in(x,y) insert({x,y})
//int dx[] = {0,1,0,-1,1,1,-1,-1};
//int dy[] = {1,0,-1,0,1,-1,-1,1};
//i64 gcd(i64 a,i64 b){if(!b)return a;return gcd(b,a%b);}
//i64 bigmod(i64 num,i64 n){if(n==0)return 1;i64 x=bigmod(num,n/2);x=x*x%mod;if(n%2==1)x=x*num%mod;return x;}
//i64 modinverse(i64 num){return bigmod(num,mod-2)%mod;}
//i64 po(i64 a,i64 b){i64 ans=1;while(b--)ans *= a;return ans;}
//i64 ncr(i64 n,i64 r){if(n==r)return 1;if(r==1)return n;if(dp[n][r]!=-1)return dp[n][r];return dp[n][r]=ncr(n-1,r)+ncr(n-1,r-1);}
#define pb push_back
#define max3(a, b, c) max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c) min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define file_read(filename) freopen("input.txt","r",stdin);
#define file_write(filename) freopen("output.txt","w",stdout);
#define sv(a) sort(a.begin(),a.end())
#define sortD(a) sort(a,a+n,greater<int>())
#define sortA(a) sort(a,a+n)
int main()
{
ll a,b,c,r,w;
cin>>w>>a>>b;
if(a<b)
{
a=a+w;
r=b-a;
if(r>=0){ printf("%lld\n",r);}
else printf("0\n");
}
else
{
b=b+w;
r=a-b;
if(r>=0){ printf("%lld\n",r);}
else printf("0\n");
}
return 0;
}
Submission Info
Submission Time
2018-05-23 05:24:45+0900
Task
B - NarrowRectanglesEasy
User
vjudge1
Language
C++14 (GCC 5.4.1)
Score
200
Code Size
1804 Byte
Status
AC
Exec Time
1 ms
Memory
256 KB
Compile Error
./Main.cpp:42:0: warning: "pb" redefined
#define pb push_back
^
./Main.cpp:19:0: note: this is the location of the previous definition
#define pb(x) push_back(x)
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
200 / 200
Status
Set Name
Test Cases
Sample
0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt
All
0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt
Case Name
Status
Exec Time
Memory
0_000.txt
AC
1 ms
256 KB
0_001.txt
AC
1 ms
256 KB
0_002.txt
AC
1 ms
256 KB
0_003.txt
AC
1 ms
256 KB
1_004.txt
AC
1 ms
256 KB
1_005.txt
AC
1 ms
256 KB
1_006.txt
AC
1 ms
256 KB
1_007.txt
AC
1 ms
256 KB
1_008.txt
AC
1 ms
256 KB
1_009.txt
AC
1 ms
256 KB