Submission #1780794


Source Code Expand

#include <cstdio>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <utility>
#include <string>

using namespace std;

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;

const int iinf = 1 << 29;
const long long linf = 1ll << 61;

#define modp(x, y) (((y) + (x) % (y)) % (y))

int main(int argc, char* argv[])
{
	int x, a, b;
	scanf("%d %d %d", &x, &a, &b);
	if(abs(x - a) < abs(x - b)) printf("A\n");
	else printf("B\n");

	return 0;
}

Submission Info

Submission Time
Task A - Meal Delivery
User neiteng
Language C++14 (GCC 5.4.1)
Score 100
Code Size 677 Byte
Status AC
Exec Time 0 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:30:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d %d", &x, &a, &b);
                               ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 10
Set Name Test Cases
Sample sample1.txt, sample2.txt
All sample1.txt, sample2.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, sample1.txt, sample2.txt
Case Name Status Exec Time Memory
1.txt AC 0 ms 128 KB
2.txt AC 0 ms 128 KB
3.txt AC 0 ms 128 KB
4.txt AC 0 ms 128 KB
5.txt AC 0 ms 128 KB
6.txt AC 0 ms 128 KB
sample1.txt AC 0 ms 128 KB
sample2.txt AC 0 ms 128 KB