結果
| 問題 |
No.3041 非対称じゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-28 22:19:37 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 964 bytes |
| コンパイル時間 | 5,174 ms |
| コンパイル使用メモリ | 332,796 KB |
| 実行使用メモリ | 8,232 KB |
| 最終ジャッジ日時 | 2025-02-28 22:20:02 |
| 合計ジャッジ時間 | 12,332 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 TLE * 2 -- * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint = atcoder::static_modint<998244353>;
// using mint = atcoder::static_modint<1000000007>;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<(int)n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};
int main(){
int n,f;cin >> n >> f;
vector<vector<int>> a(n,vector<int>(3));
rep(i,0,3)rep(j,0,n)cin >> a[j][i];
int maxsize=0;
rep(i,0,n){
sort(a[i].begin(),a[i].end());
maxsize+=a[i][2]-a[i][0];
}
vector<bool> dp(maxsize+1);
dp[0]=true;
int ans=1;
int m=0;
rep(i,0,n){
int x=a[i][1]-a[i][0],y=a[i][2]-a[i][0];
m+=y;
for(int j=m; j>=0; j--)if(!dp[j]){
if(j-x>=0 && dp[j-x])dp[j]=true;
if(j-y>=0 && dp[j-y])dp[j]=true;
if(dp[j])ans++;
}
cout << ans << "\n";
}
}