結果

問題 No.1628 Sorting Integers (MAX of M)
ユーザー Kou0406
提出日時 2025-01-11 12:04:52
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 1,654 ms
コンパイル使用メモリ 76,400 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-11 12:04:55
合計ジャッジ時間 1,757 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
main.cpp:14:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |     rep(i,X)scanf("%d",&c[i]);
      |             ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#define rep(i,n) for(i=0;i<(int)(n);i++)
#define X 9
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int n,c[X];

int main(){
    int i;
    ll m=0;
    scanf("%d",&n);
    rep(i,X)scanf("%d",&c[i]);
    i=X-1;
    while(i>=0){
        while(c[i]>0){
            m*=10;
            m+=i+1;
            c[i]--;
        }
        i--;
    }
    printf("%lld\n",m);
    return 0;
}
0