結果
問題 | No.1359 [Zelkova 3rd Tune] 四人セゾン |
ユーザー | first_vil |
提出日時 | 2021-01-22 21:35:59 |
言語 | C++17 (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 278 ms / 2,000 ms |
コード長 | 3,189 bytes |
コンパイル時間 | 2,194 ms |
コンパイル使用メモリ | 208,488 KB |
実行使用メモリ | 11,160 KB |
最終ジャッジ日時 | 2023-08-27 17:50:37 |
合計ジャッジ時間 | 21,654 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 1 ms
4,376 KB |
testcase_03 | AC | 139 ms
7,136 KB |
testcase_04 | AC | 139 ms
7,056 KB |
testcase_05 | AC | 126 ms
7,048 KB |
testcase_06 | AC | 126 ms
6,948 KB |
testcase_07 | AC | 189 ms
8,636 KB |
testcase_08 | AC | 189 ms
8,648 KB |
testcase_09 | AC | 54 ms
4,676 KB |
testcase_10 | AC | 54 ms
4,640 KB |
testcase_11 | AC | 244 ms
10,232 KB |
testcase_12 | AC | 244 ms
10,116 KB |
testcase_13 | AC | 156 ms
7,588 KB |
testcase_14 | AC | 157 ms
7,480 KB |
testcase_15 | AC | 138 ms
7,048 KB |
testcase_16 | AC | 138 ms
7,012 KB |
testcase_17 | AC | 261 ms
10,448 KB |
testcase_18 | AC | 261 ms
10,380 KB |
testcase_19 | AC | 225 ms
9,324 KB |
testcase_20 | AC | 226 ms
9,308 KB |
testcase_21 | AC | 243 ms
9,952 KB |
testcase_22 | AC | 242 ms
9,896 KB |
testcase_23 | AC | 165 ms
8,116 KB |
testcase_24 | AC | 164 ms
8,000 KB |
testcase_25 | AC | 27 ms
4,380 KB |
testcase_26 | AC | 26 ms
4,376 KB |
testcase_27 | AC | 86 ms
5,476 KB |
testcase_28 | AC | 86 ms
5,572 KB |
testcase_29 | AC | 105 ms
6,220 KB |
testcase_30 | AC | 109 ms
6,196 KB |
testcase_31 | AC | 141 ms
7,216 KB |
testcase_32 | AC | 141 ms
7,284 KB |
testcase_33 | AC | 104 ms
5,940 KB |
testcase_34 | AC | 104 ms
6,164 KB |
testcase_35 | AC | 139 ms
6,928 KB |
testcase_36 | AC | 138 ms
7,016 KB |
testcase_37 | AC | 28 ms
4,376 KB |
testcase_38 | AC | 29 ms
4,376 KB |
testcase_39 | AC | 23 ms
4,376 KB |
testcase_40 | AC | 23 ms
4,380 KB |
testcase_41 | AC | 49 ms
4,380 KB |
testcase_42 | AC | 49 ms
4,400 KB |
testcase_43 | AC | 39 ms
4,380 KB |
testcase_44 | AC | 257 ms
10,380 KB |
testcase_45 | AC | 109 ms
6,260 KB |
testcase_46 | AC | 38 ms
4,376 KB |
testcase_47 | AC | 184 ms
8,316 KB |
testcase_48 | AC | 172 ms
7,996 KB |
testcase_49 | AC | 174 ms
8,308 KB |
testcase_50 | AC | 134 ms
6,980 KB |
testcase_51 | AC | 8 ms
4,380 KB |
testcase_52 | AC | 231 ms
9,704 KB |
testcase_53 | AC | 262 ms
10,900 KB |
testcase_54 | AC | 274 ms
10,904 KB |
testcase_55 | AC | 271 ms
10,908 KB |
testcase_56 | AC | 274 ms
11,016 KB |
testcase_57 | AC | 277 ms
10,952 KB |
testcase_58 | AC | 275 ms
11,012 KB |
testcase_59 | AC | 273 ms
11,016 KB |
testcase_60 | AC | 267 ms
11,024 KB |
testcase_61 | AC | 254 ms
10,888 KB |
testcase_62 | AC | 272 ms
10,936 KB |
testcase_63 | AC | 273 ms
10,904 KB |
testcase_64 | AC | 274 ms
10,900 KB |
testcase_65 | AC | 270 ms
10,976 KB |
testcase_66 | AC | 271 ms
10,900 KB |
testcase_67 | AC | 278 ms
11,016 KB |
testcase_68 | AC | 266 ms
10,908 KB |
testcase_69 | AC | 252 ms
11,012 KB |
testcase_70 | AC | 252 ms
11,160 KB |
testcase_71 | AC | 244 ms
11,040 KB |
testcase_72 | AC | 277 ms
10,988 KB |
testcase_73 | AC | 270 ms
10,896 KB |
testcase_74 | AC | 267 ms
11,024 KB |
testcase_75 | AC | 268 ms
10,976 KB |
testcase_76 | AC | 264 ms
10,900 KB |
testcase_77 | AC | 266 ms
10,908 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using VI = vector<int>; using VL = vector<ll>; using VS = vector<string>; template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>; #define FOR(i,a,n) for(int i=(a);i<(n);++i) #define eFOR(i,a,n) for(int i=(a);i<=(n);++i) #define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i) #define erFOR(i,a,n) for(int i=(n);i>=(a);--i) #define SORT(a) sort(a.begin(),a.end()) #define rSORT(a) sort(a.rbegin(),a.rend()) #define fSORT(a,f) sort(a.begin(),a.end(),f) #define all(a) a.begin(),a.end() #define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x)) #define tp(a,i) get<i>(a) #ifdef _DEBUG #define line cout << "-----------------------------\n" #define stop system("pause") #define debug(x) print(x) #endif constexpr ll INF = 1000000000; constexpr ll LLINF = 1LL << 60; constexpr ll mod = 1000000007; constexpr ll MOD = 998244353; constexpr ld eps = 1e-10; constexpr ld pi = 3.1415926535897932; template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; } template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; } inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; } template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; } template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); } template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); } template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); } template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); } template<class T>inline void print(const T& a) { cout << a << "\n"; } template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); } template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); } template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); } inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; } template<class T>inline T sum(const vector<T>& a, int l, int r) { return a[r] - (l == 0 ? 0 : a[l - 1]); } template<class T>inline void END(T s) { print(s); exit(0); } void END() { exit(0); } ll modpow(ll n, ll k, ll m) { if (n == 0)return 0; ll res = 1; for (; k; k >>= 1, n = n * n % m) { if (k & 1)res = res * n % m; } return res; } int main() { init(); int n; ll k, m; cin >> n >> k >> m; auto p = vec<ll>(4, n); cin >> p; FOR(i, 0, 4)SORT(p[i]); ll ans = 0; FOR(i, 0, n) { ans = (ans + modpow(max({ p[0][i],p[1][i],p[2][i],p[3][i] }) - min({ p[0][i],p[1][i],p[2][i],p[3][i] }), k, m)) % m; } print(ans); return 0; }