1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AtCoder C++】ABC073 - Theater

Last updated at Posted at 2024-03-05

学習記録用 B - Theater

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  int result = 0;
  
  int l,r;
  for (int i = 0; i < N; i++){
    cin >> l >> r;
    result += r - l + 1;
  }
  cout << result;
}

// 2
// 6 8
// 3 3

// 4


これはすんなりいけた!嬉しい!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?