結果

問題 No.1905 PURE PHRASE
ユーザー RubikunRubikun
提出日時 2022-04-15 21:52:41
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,585 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 208,984 KB
実行使用メモリ 4,564 KB
最終ジャッジ日時 2023-08-26 07:50:10
合計ジャッジ時間 3,698 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
4,376 KB
testcase_01 AC 9 ms
4,380 KB
testcase_02 AC 9 ms
4,376 KB
testcase_03 AC 9 ms
4,380 KB
testcase_04 AC 8 ms
4,376 KB
testcase_05 AC 9 ms
4,380 KB
testcase_06 AC 9 ms
4,380 KB
testcase_07 AC 10 ms
4,484 KB
testcase_08 AC 9 ms
4,380 KB
testcase_09 AC 9 ms
4,380 KB
testcase_10 AC 9 ms
4,376 KB
testcase_11 AC 8 ms
4,564 KB
testcase_12 AC 9 ms
4,376 KB
testcase_13 AC 9 ms
4,380 KB
testcase_14 AC 8 ms
4,380 KB
testcase_15 AC 8 ms
4,384 KB
testcase_16 AC 9 ms
4,380 KB
testcase_17 AC 9 ms
4,380 KB
testcase_18 AC 9 ms
4,376 KB
testcase_19 AC 9 ms
4,428 KB
testcase_20 AC 8 ms
4,376 KB
testcase_21 AC 9 ms
4,380 KB
testcase_22 AC 8 ms
4,500 KB
testcase_23 AC 9 ms
4,376 KB
testcase_24 AC 8 ms
4,380 KB
testcase_25 AC 9 ms
4,380 KB
testcase_26 AC 9 ms
4,488 KB
testcase_27 AC 9 ms
4,384 KB
testcase_28 AC 9 ms
4,564 KB
testcase_29 AC 9 ms
4,376 KB
testcase_30 AC 9 ms
4,384 KB
testcase_31 AC 9 ms
4,424 KB
testcase_32 AC 9 ms
4,420 KB
testcase_33 AC 8 ms
4,380 KB
testcase_34 AC 8 ms
4,384 KB
testcase_35 AC 9 ms
4,424 KB
testcase_36 AC 8 ms
4,380 KB
testcase_37 AC 9 ms
4,384 KB
testcase_38 AC 8 ms
4,376 KB
testcase_39 AC 9 ms
4,380 KB
testcase_40 AC 9 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005;
const ll INF=1LL<<60;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N;cin>>N;
    ll now=0;
    
    vector<ll> S={168, 150, 135, 126, 112, 101, 90};
    //for(int i=0;i<7;i++) S[i]=N/S[i];
    vector<ll> A(N);
    vector<int> ord(N);
    vector<pair<ll,int>> B(N);
    for(int i=0;i<N;i++){
        int x;cin>>x;
        now+=x;
        A[i]=now;
        B[i]=mp(now,i);
        //cout<<i<<" "<<now<<endl;
    }
    sort(all(B));
    for(int i=0;i<N;i++){
        ord[B[i].se]=i;
    }
    
    pair<ll,int> mi=mp(INF,-1);
    for(int t=0;t<7;t++){
        ll gosa=0;
        for(int i=0;i<S[t];i++){
            ll sum=0,cn=0;
            for(int j=i;j<N;j+=S[t]){
                sum+=A[j];
                cn++;
            }
            ll m=sum/cn,X=0;
            for(int j=i;j<N;j+=S[t]){
                X+=(A[j]-m)*(A[j]-m);
            }
            gosa+=sqrtl((long double)(X)/cn);
        }
        gosa/=S[t];
        chmin(mi,mp(gosa,t));
        
        //cout<<gosa<<" "<<t<<endl;
    }
    
    string U="CDEFGAB";
    
    cout<<U[mi.se]<<4<<endl;
}
0