結果

問題 No.1156 Nada Picnic 2
ユーザー 👑 CleyL
提出日時 2024-01-20 23:03:49
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 663 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 75,948 KB
最終ジャッジ日時 2025-02-18 21:54:58
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int n;cin>>n;
  if(n==1){
    cout << 1521 << endl;
  }else if(n==2){
    cout << 10649 << endl;
  }else{
    vector<int> x = {0,1,2,3,4,5,6,7,8,9};
    vector<int> k = {100000, 10000-100000, 1000, 1100-10010, 10, 101, 10000, 10-101, 1, -1000};
    do{
      if(x[0] == 0 || x[1] == 0 || x[6] == 0)continue;
      int cur = 0;
      for(int i = 0; 10 > i; i++){
        cur = x[i]*k[i];
      }
      if(cur == 0){
        cout << x[1] << x[3] << x[9] << x[7] << x[3] << x[9] << endl;
        return 0;
      }

    }while(next_permutation(x.begin(), x.end()));
  }
}
0