結果

問題 No.129 お年玉(2)
コンテスト
ユーザー itezpace
提出日時 2016-07-28 09:39:53
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
MLE  
実行時間 -
コード長 485 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 814 ms
コンパイル使用メモリ 94,432 KB
実行使用メモリ 2,435,584 KB
最終ジャッジ日時 2026-05-06 23:01:10
合計ジャッジ時間 13,642 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other MLE * 2 -- * 44
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;
const int mod=1e9;
int main(){
  ll n,m;
  cin>>n>>m;
  ll a,b;
  a=n/1000;
  b=a%m;
  vector<int> v;
  for(int i=0; i<m; ++i){
    v.push_back(0);
  }
  for(int i=m-1; i>=m-b; --i){
    v[i]=1;
  }
  set<vector<int>> s;
  do{
    s.insert(v);
  } while(next_permutation(v.begin(),v.end()));
  int c;
  c=s.size()%mod;
  cout<<c<<endl;
  return 0;
}
0