結果
問題 | No.799 赤黒かーどげぇむ |
ユーザー |
![]() |
提出日時 | 2020-05-17 08:31:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,299 bytes |
コンパイル時間 | 1,542 ms |
コンパイル使用メモリ | 165,664 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 18:44:48 |
合計ジャッジ時間 | 2,265 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int,int> pii; typedef int _loop_int; #define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i) #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i) #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i) #define VIN(v) for(auto&elem_: (v) )cin>>elem_ #define VOUT(v, sep) for(_loop_int idx=0; idx<(_loop_int)v.size(); idx++) {cout<<v[idx]; if(idx<v.size()-1) cout<<sep;} cout<<endl #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(debugidx,v.size())cout<<" "<<v[debugidx];cout<<endl #define DEBUG_ARR(v,n) cout<<#v<<":";REP(debugidx,n)cout<<" "<<v[debugidx];cout<<endl #define ALL(a) (a).begin(),(a).end() const ll MOD = 1000000007ll; const int IINF = numeric_limits<int>::max()/2-1; const ll LINF = numeric_limits<ll>::max()/2-1; #define FIX(a) ((a)%MOD+MOD)%MOD int a,b,c,d; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>a>>b>>c>>d; int ans=0; FOR(i,a,b+1){ if(i>=c && i<=d){ ans+=d-c; }else{ ans+=d-c+1; } } cout << ans << endl; return 0; }