提出 #73068994


ソースコード 拡げる

#if !__INCLUDE_LEVEL__
#include __FILE__

void solve() {
  int N;
  cin>>N;
  vi A(1000000,0);
  int c=1000000;
  rep(i,N){
    int x;
    cin>>x;
    A[x-1]++;
  }
  RREP(i,1,c){
    A[i-1]+=A[i];
  }
  int b=0;
  rep(i,c){
    A[i]+=b;
    b=A[i]/10;
    A[i]%=10;
  }
  int f=0;
  rrep(i,c){
    if(A[i]!=0){
      f=i;
      break;
    }
  }
  rrep(i,f+1)cout<<A[i];
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int T=1;
    //cin>>T;
    while(T--)solve();
}

#else
#include <bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;
//using mint=modint998244353;
//using mint=modint1000000007;
  
// 関数テンプレート
template<typename T> bool chmax(T &m, const T q) {
    if (m < q) {m = q; return true;} else return false; }

template<typename T> bool chmin(T &m,const T q){
    if(m>q){m=q;return true;}else return false;
}
template<typename T>
bool grid_inside(const T h, const T w, const T &m, const T &n) {
    return (m >= 0 && m < h && n >= 0 && n < w);
}
// ループマクロ
#define rep(i,r) for(int i=0;(r)>i;i++)
#define REP(i,l,r) for(int i=(l);i<(r);i++)
#define rrep(i,N) for(int i=(N)-1;i>=0;i--)
#define RREP(i,r,N) for(int i=(N)-1;i>=r;i--)

// コンテナショートカット
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define el '\n'
#define spa " "
#define pb push_back
#define fixed15 std::fixed << std::setprecision(15)
#define popcntll(x) __builtin_popcountll(x)
// YES/NO 出力
#define Yes cout<<"Yes"<<el
#define No cout<<"No"<<el
#define YES cout<<"YES"<<el
#define NO cout<<"NO"<<el
#define YESNO(bool) if(bool){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(bool) if(bool){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

// 型エイリアス
using ll=long long;
using ull=unsigned long long;
using pqgi=priority_queue<int, vector<int>, greater<int>>;
using pqgl=priority_queue<long long, vector<long long>, greater<long long>>;
using pqgpl=priority_queue<pair<long long,long long>,vector<pair<long long,long long>>,greater<pair<long long,long long>>>;
using pqgptpl=priority_queue<tuple<ll,ll,ll>,vector<tuple<ll,ll,ll>>,greater<tuple<ll,ll,ll>>>;
using pqi=priority_queue<int>;
using pii=pair<int, int>;
using tpi=tuple<int,int,int>;
using tpl=tuple<ll,ll,ll>;
using pll=pair<long long, long long>;
using vs=vector<string>;
using vi=vector<int>;
using vb=vector<bool>;
using vl=vector<long long>;
using vc=vector<char>;
using vvi=vector<vector<int>>;
using vvl=vector<vector<long long>>;
using vvc=vector<vector<char>>;
using vvb=vector<vector<bool>>;
using vvs=vector<vector<string>>;
using vpii=vector<pii>;
using vpll=vector<pll>;
using vvpii=vector<vector<pii>>;
using vvpll=vector<vector<pll>>;
using vtiii=vector<tuple<int, int, int>>;
using lb=long double;

// 定数
const long long INF=1e18;
const int mod=1e9+7;
//const int mod=998244353;
const int MAX=1e5+10;
const int MIN=-1e9;
const vpii dir={{1,0},{-1,0},{0,1},{0,-1}};
const vpii ddir={{1,0},{-1,0},{0,1},{0,-1},{-1,-1},{1,1},{-1,1},{1,-1}};
#endif


提出情報

提出日時
問題 D - Many Repunit Sum
ユーザ yasaikeikaku
言語 C++23 (GCC 15.2.0)
得点 400
コード長 3252 Byte
結果 AC
実行時間 16 ms
メモリ 7412 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 30
セット名 テストケース
Sample 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt
All 0_sample_1.txt, 0_sample_2.txt, 0_sample_3.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt, 1_20.txt, 2_1.txt, 2_2.txt, 2_3.txt, 2_4.txt, 2_5.txt, 2_6.txt, 2_7.txt
ケース名 結果 実行時間 メモリ
0_sample_1.txt AC 5 ms 7288 KiB
0_sample_2.txt AC 5 ms 7328 KiB
0_sample_3.txt AC 5 ms 7260 KiB
1_01.txt AC 15 ms 7256 KiB
1_02.txt AC 15 ms 7252 KiB
1_03.txt AC 15 ms 7256 KiB
1_04.txt AC 15 ms 7376 KiB
1_05.txt AC 15 ms 7252 KiB
1_06.txt AC 15 ms 7260 KiB
1_07.txt AC 15 ms 7412 KiB
1_08.txt AC 15 ms 7328 KiB
1_09.txt AC 15 ms 7108 KiB
1_10.txt AC 15 ms 7380 KiB
1_11.txt AC 15 ms 7260 KiB
1_12.txt AC 15 ms 7328 KiB
1_13.txt AC 15 ms 7260 KiB
1_14.txt AC 15 ms 7412 KiB
1_15.txt AC 15 ms 7380 KiB
1_16.txt AC 15 ms 7380 KiB
1_17.txt AC 16 ms 7140 KiB
1_18.txt AC 15 ms 7260 KiB
1_19.txt AC 15 ms 7328 KiB
1_20.txt AC 15 ms 7260 KiB
2_1.txt AC 9 ms 7328 KiB
2_2.txt AC 9 ms 7412 KiB
2_3.txt AC 14 ms 7140 KiB
2_4.txt AC 11 ms 7232 KiB
2_5.txt AC 5 ms 7340 KiB
2_6.txt AC 8 ms 7288 KiB
2_7.txt AC 7 ms 7328 KiB