結果
| 問題 | No.3709 Unknown Treasure |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2026-09-11 23:59:28 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 75 ms / 2,000 ms |
| + 300µs | |
| コード長 | 764 bytes |
| 記録 | |
| コンパイル時間 | 2,039 ms |
| コンパイル使用メモリ | 331,444 KB |
| 実行使用メモリ | 19,456 KB |
| 最終ジャッジ日時 | 2026-09-12 00:01:03 |
| 合計ジャッジ時間 | 5,737 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n-1);i>=0;i--)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>;
using u128=__int128_t;
using ll=long long;
int G[2020][2020];
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int h,w,n;
cin>>h>>w>>n;
rep(i,n){
int r1,c1,r2,c2;
cin>>r1>>c1>>r2>>c2;
r1--,c1--;
G[r1][c1]++;
G[r1][c2]--;
G[r2][c1]--;
G[r2][c2]++;
}
rep(i,h) rep(j,w) G[i][j+1]+=G[i][j];
rep(j,w) rep(i,h) G[i+1][j]+=G[i][j];
int ans=0;
rep(i,h) rep(j,w) if(G[i][j]==0) ans++;
cout<<ans<<endl;
return 0;
}
umezo