結果
問題 | No.1279 Array Battle |
ユーザー |
![]() |
提出日時 | 2020-12-10 08:47:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 483 bytes |
コンパイル時間 | 2,153 ms |
コンパイル使用メモリ | 197,664 KB |
最終ジャッジ日時 | 2025-01-16 21:15:49 |
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 WA * 4 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector<int> a(n),b(n); for(auto&ai:a)cin>>ai; for(auto&bi:b)cin>>bi; int pmax=0,ans=0; sort(begin(a),end(a)); do{ int p=0; for(int i=0;i<n;++i)if(a[i]>b[i]){ p+=a[i]-b[i]; } if(p>pmax){ pmax=p; ans=1; } else if(p==pmax)ans++; }while(next_permutation(begin(a),end(a))); cout<<ans<<endl; }