結果

問題 No.1359 [Zelkova 3rd Tune] 四人セゾン
ユーザー 👑 PCTprobabilityPCTprobability
提出日時 2021-01-22 21:29:14
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 285 ms / 2,000 ms
コード長 1,437 bytes
コンパイル時間 4,778 ms
コンパイル使用メモリ 132,108 KB
実行使用メモリ 9,452 KB
最終ジャッジ日時 2023-08-27 17:29:12
合計ジャッジ時間 24,085 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 137 ms
6,212 KB
testcase_04 AC 137 ms
6,120 KB
testcase_05 AC 121 ms
6,244 KB
testcase_06 AC 126 ms
6,168 KB
testcase_07 AC 188 ms
7,440 KB
testcase_08 AC 186 ms
7,608 KB
testcase_09 AC 54 ms
4,408 KB
testcase_10 AC 54 ms
4,380 KB
testcase_11 AC 244 ms
8,620 KB
testcase_12 AC 248 ms
8,596 KB
testcase_13 AC 154 ms
6,760 KB
testcase_14 AC 155 ms
6,704 KB
testcase_15 AC 140 ms
6,176 KB
testcase_16 AC 138 ms
6,232 KB
testcase_17 AC 262 ms
8,928 KB
testcase_18 AC 263 ms
8,896 KB
testcase_19 AC 226 ms
7,972 KB
testcase_20 AC 224 ms
8,068 KB
testcase_21 AC 243 ms
8,596 KB
testcase_22 AC 238 ms
8,556 KB
testcase_23 AC 158 ms
6,972 KB
testcase_24 AC 164 ms
7,020 KB
testcase_25 AC 26 ms
4,376 KB
testcase_26 AC 27 ms
4,380 KB
testcase_27 AC 88 ms
5,124 KB
testcase_28 AC 87 ms
5,064 KB
testcase_29 AC 106 ms
5,332 KB
testcase_30 AC 107 ms
5,384 KB
testcase_31 AC 140 ms
6,444 KB
testcase_32 AC 140 ms
6,436 KB
testcase_33 AC 105 ms
5,428 KB
testcase_34 AC 104 ms
5,388 KB
testcase_35 AC 139 ms
6,180 KB
testcase_36 AC 137 ms
6,176 KB
testcase_37 AC 29 ms
4,376 KB
testcase_38 AC 29 ms
4,376 KB
testcase_39 AC 24 ms
4,376 KB
testcase_40 AC 24 ms
4,380 KB
testcase_41 AC 50 ms
4,376 KB
testcase_42 AC 51 ms
4,380 KB
testcase_43 AC 40 ms
4,380 KB
testcase_44 AC 263 ms
9,072 KB
testcase_45 AC 111 ms
5,428 KB
testcase_46 AC 38 ms
4,376 KB
testcase_47 AC 188 ms
7,180 KB
testcase_48 AC 175 ms
6,956 KB
testcase_49 AC 177 ms
7,232 KB
testcase_50 AC 135 ms
6,240 KB
testcase_51 AC 8 ms
4,376 KB
testcase_52 AC 234 ms
8,288 KB
testcase_53 AC 267 ms
9,348 KB
testcase_54 AC 279 ms
9,432 KB
testcase_55 AC 276 ms
9,452 KB
testcase_56 AC 279 ms
9,348 KB
testcase_57 AC 282 ms
9,404 KB
testcase_58 AC 280 ms
9,412 KB
testcase_59 AC 277 ms
9,408 KB
testcase_60 AC 272 ms
9,288 KB
testcase_61 AC 258 ms
9,424 KB
testcase_62 AC 276 ms
9,432 KB
testcase_63 AC 278 ms
9,356 KB
testcase_64 AC 281 ms
9,432 KB
testcase_65 AC 275 ms
9,344 KB
testcase_66 AC 279 ms
9,428 KB
testcase_67 AC 285 ms
9,288 KB
testcase_68 AC 272 ms
9,336 KB
testcase_69 AC 255 ms
9,388 KB
testcase_70 AC 255 ms
9,400 KB
testcase_71 AC 248 ms
9,344 KB
testcase_72 AC 281 ms
9,436 KB
testcase_73 AC 227 ms
9,392 KB
testcase_74 AC 225 ms
9,348 KB
testcase_75 AC 226 ms
9,340 KB
testcase_76 AC 225 ms
9,292 KB
testcase_77 AC 228 ms
9,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(s) (s).begin(),(s).end()
#define vcin(n) for(ll i=0;i<ll(n.size());i++) cin>>n[i]
#define rep2(i, m, n) for (int i = (m); i < (n); ++i)
#define rep(i, n) rep2(i, 0, n)
#define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i)
#define drep(i, n) drep2(i, n, 0)
#define rever(vec) reverse(vec.begin(), vec.end())
#define sor(vec) sort(vec.begin(), vec.end())
#define fi first
#define se second
//const ll mod = 998244353;
const ll mod = 1000000007;
const ll inf = 2000000000000000000ll;
static const long double pi = 3.141592653589793;
template<class T,class U> void chmax(T& t,const U& u){if(t<u) t=u;}
template<class T,class U> void chmin(T& t,const U& u){if(t>u) t=u;}
ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; }

int main() {
  /* mod は 1e9+7 */
  ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
  cout<< fixed << setprecision(10);
  ll a;
  cin>>a;
  ll k,m;
  cin>>k>>m;
  vector<ll> x1(a);
  vcin(x1);
  vector<ll> x2(a);
  vcin(x2);
  vector<ll> x3(a);
  vcin(x3);
  vector<ll> x4(a);
  vcin(x4);
  sor(x1);
  sor(x2);
  sor(x3);
  sor(x4);
  ll ans=0;
  for(int i=0;i<a;i++){
    ans+=modPow(max(max(x1[i],x2[i]),max(x3[i],x4[i]))-(min(min(x1[i],x2[i]),min(x3[i],x4[i]))),k,m);
    ans%=m;
  }
  cout<<ans<<endl;
}
0