結果

問題 No.1905 PURE PHRASE
ユーザー RubikunRubikun
提出日時 2022-04-15 21:48:08
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,571 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 210,720 KB
実行使用メモリ 5,724 KB
最終ジャッジ日時 2023-08-26 07:46:09
合計ジャッジ時間 4,140 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
5,472 KB
testcase_01 AC 15 ms
5,476 KB
testcase_02 AC 15 ms
5,480 KB
testcase_03 AC 14 ms
5,484 KB
testcase_04 AC 15 ms
5,552 KB
testcase_05 AC 15 ms
5,484 KB
testcase_06 AC 14 ms
5,496 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 16 ms
5,556 KB
testcase_10 AC 15 ms
5,476 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 15 ms
5,592 KB
testcase_14 WA -
testcase_15 AC 15 ms
5,504 KB
testcase_16 WA -
testcase_17 AC 14 ms
5,492 KB
testcase_18 AC 15 ms
5,560 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 16 ms
5,528 KB
testcase_22 AC 14 ms
5,468 KB
testcase_23 AC 14 ms
5,524 KB
testcase_24 WA -
testcase_25 AC 15 ms
5,544 KB
testcase_26 WA -
testcase_27 AC 14 ms
5,496 KB
testcase_28 WA -
testcase_29 AC 14 ms
5,548 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 14 ms
5,540 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 16 ms
5,496 KB
testcase_36 AC 15 ms
5,548 KB
testcase_37 AC 14 ms
5,492 KB
testcase_38 WA -
testcase_39 AC 14 ms
5,480 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long double 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={262, 294, 327, 349, 392, 436, 491};
    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(X/cn);
        }
        gosa/=S[t];
        chmin(mi,mp(gosa,t));
        
        //cout<<gosa<<" "<<t<<endl;
    }
    
    string U="CDEFGAB";
    
    cout<<U[mi.se]<<4<<endl;
}
0