結果

問題 No.2261 Coffee
ユーザー hourenhouren
提出日時 2023-04-07 22:03:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 171 ms / 2,000 ms
コード長 1,104 bytes
コンパイル時間 1,551 ms
コンパイル使用メモリ 169,784 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2024-04-10 17:06:30
合計ジャッジ時間 7,316 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 6 ms
5,376 KB
testcase_18 AC 5 ms
5,376 KB
testcase_19 AC 4 ms
5,376 KB
testcase_20 AC 4 ms
5,376 KB
testcase_21 AC 6 ms
5,376 KB
testcase_22 AC 5 ms
5,376 KB
testcase_23 AC 6 ms
5,376 KB
testcase_24 AC 147 ms
36,608 KB
testcase_25 AC 131 ms
31,872 KB
testcase_26 AC 157 ms
39,040 KB
testcase_27 AC 147 ms
36,224 KB
testcase_28 AC 90 ms
33,408 KB
testcase_29 AC 89 ms
32,640 KB
testcase_30 AC 69 ms
26,368 KB
testcase_31 AC 112 ms
39,168 KB
testcase_32 AC 115 ms
39,296 KB
testcase_33 AC 111 ms
39,168 KB
testcase_34 AC 112 ms
39,168 KB
testcase_35 AC 110 ms
39,168 KB
testcase_36 AC 114 ms
39,168 KB
testcase_37 AC 110 ms
39,296 KB
testcase_38 AC 159 ms
39,168 KB
testcase_39 AC 161 ms
39,256 KB
testcase_40 AC 160 ms
39,296 KB
testcase_41 AC 161 ms
39,168 KB
testcase_42 AC 161 ms
39,040 KB
testcase_43 AC 171 ms
39,264 KB
testcase_44 AC 171 ms
39,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL << 62), MOD = 998244353;
constexpr int INF = (1 << 30);

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<vector<ll>> a(n,vector<ll>(5)), x(n,vector<ll>(1<<5,0));
    vector<ll> ma(1<<5, -INFLL), mi(1<<5, INFLL);
    rep(i,n){
        rep(j,5) cin >> a[i][j];
        rep(j,1<<5){
            rep(k,5) x[i][j] += a[i][k] * (1 - ((j>>k)&1)*2);
            chmin(mi[j], x[i][j]);
            chmax(ma[j], x[i][j]);
        }
    }
    rep(i,n){
        ll ans = 0;
        rep(j,1<<5) chmax(ans, abs(x[i][j]-ma[j]));
        rep(j,1<<5) chmax(ans, abs(x[i][j]-mi[j]));
        cout << ans << '\n';
    }
    return 0;
}
0