Submission #4637222


Source Code Expand

// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  ll n, ans;
  scanf("%lld", &n);
  for (int i = 0; i < n; i++)
  {
    ll a, b;
    scanf("%lld%lld", &a, &b);
    ans += b - a + 1;
  }
  printf("%lld\n", ans);
  return 0;
}

Submission Info

Submission Time
Task B - Theater
User teto
Language C (GCC 5.4.1)
Score 200
Code Size 861 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:21:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld", &n);
   ^
./Main.c:25:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld%lld", &a, &b);
     ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 8
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
01.txt AC 1 ms 128 KB
02.txt AC 1 ms 128 KB
03.txt AC 1 ms 128 KB
04.txt AC 1 ms 128 KB
05.txt AC 1 ms 128 KB
06.txt AC 1 ms 128 KB
sample_01.txt AC 1 ms 128 KB
sample_02.txt AC 1 ms 128 KB