結果

問題 No.129 お年玉(2)
ユーザー itezpace
提出日時 2016-07-28 09:39:53
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 485 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 73,056 KB
実行使用メモリ 816,384 KB
最終ジャッジ日時 2024-11-06 18:06:52
合計ジャッジ時間 12,833 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other MLE * 1 -- * 45
権限があれば一括ダウンロードができます

ソースコード

diff #

#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