結果
問題 | No.2999 Long Long Friedrice |
ユーザー |
|
提出日時 | 2024-12-25 10:05:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 428 bytes |
コンパイル時間 | 814 ms |
コンパイル使用メモリ | 70,604 KB |
実行使用メモリ | 28,288 KB |
最終ジャッジ日時 | 2024-12-25 10:05:06 |
合計ジャッジ時間 | 2,905 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 6 |
other | AC * 33 |
ソースコード
#include<iostream> #include<vector> #include<cassert> using namespace std; bool vis[1<<20]; vector<int>G[1<<20]; int N,A[2000]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N; for(int i=0;i<N;i++)cin>>A[i]; for(int i=0;i<N;i++) { int B;cin>>B; G[A[i]].push_back(A[i]+B); } vis[1]=true; int mx=1; for(int i=1;i<1<<20;i++)if(vis[i]) { mx=i; for(int v:G[i])vis[v]=true; } cout<<mx<<endl; }