結果
| 問題 | No.3709 Unknown Treasure |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-11 22:52:44 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 91 ms / 2,000 ms |
| + 201µs | |
| コード長 | 719 bytes |
| 記録 | |
| コンパイル時間 | 1,113 ms |
| コンパイル使用メモリ | 210,304 KB |
| 実行使用メモリ | 35,072 KB |
| 最終ジャッジ日時 | 2026-09-11 22:52:53 |
| 合計ジャッジ時間 | 5,023 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
ll a[2010][2010];
int main(void){
cin.tie(nullptr); ios_base::sync_with_stdio(false);
ll i,j;
ll H,W,N;
cin >> H >> W >> N;
REP(i,N){
ll r,c,r1,c1;
cin >> r >> c >> r1 >> c1;
a[r][c]++;
a[r][c1+1]--;
a[r1+1][c]--;
a[r1+1][c1+1]++;
}
for(i=1;i<=H;i++){
for(j=1;j<=W;j++){
a[i][j]+=a[i][j-1];
}
}
for(j=1;j<=W;j++){
for(i=1;i<=H;i++){
a[i][j]+=a[i-1][j];
}
}
ll ans=0;
for(j=1;j<=W;j++){
for(i=1;i<=H;i++){
if(a[i][j]==0) ans++;
}
}
cout << ans << endl;
return 0;
}