結果
| 問題 |
No.1074 増殖
|
| コンテスト | |
| ユーザー |
Shibuyap
|
| 提出日時 | 2020-06-05 22:13:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,257 bytes |
| コンパイル時間 | 2,398 ms |
| コンパイル使用メモリ | 192,368 KB |
| 最終ジャッジ日時 | 2025-01-10 22:38:43 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 TLE * 4 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("YES");}else{puts("NO");}
#define MAX_N 200005
int main() {
int dp[4][20001];
rep(i,4)rep(j,20001)dp[i][j] = 0;
int n;
cin >> n;
rep(loop, n){
int a, b, c ,d;
cin >> a >> b >> c >> d;
a *= -1; b *= -1;
int ans = 0;
drep(i,b+1){
if(i == 0)break;
if(dp[0][i] < a){
ans += a - dp[0][i];
dp[0][i] = a;
}
}
drep(i,d+1){
if(i == 0)break;
if(dp[1][i] < a){
ans += a - dp[1][i];
dp[1][i] = a;
}
}
drep(i,b+1){
if(i == 0)break;
if(dp[2][i] < c){
ans += c - dp[2][i];
dp[2][i] = c;
}
}
drep(i,d+1){
if(i == 0)break;
if(dp[3][i] < c){
ans += c - dp[3][i];
dp[3][i] = c;
}
}
cout << ans << endl;
}
}
Shibuyap