結果

問題 No.305 鍵(2)
ユーザー 👑 obakyanobakyan
提出日時 2019-05-02 08:26:07
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 1,057 bytes
コンパイル時間 653 ms
コンパイル使用メモリ 71,340 KB
実行使用メモリ 24,372 KB
平均クエリ数 45.15
最終ジャッジ日時 2023-09-24 02:14:23
合計ジャッジ時間 2,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
23,856 KB
testcase_01 AC 27 ms
24,288 KB
testcase_02 AC 26 ms
23,640 KB
testcase_03 AC 27 ms
23,520 KB
testcase_04 AC 28 ms
24,372 KB
testcase_05 AC 28 ms
24,348 KB
testcase_06 AC 25 ms
23,376 KB
testcase_07 AC 26 ms
23,400 KB
testcase_08 AC 27 ms
23,568 KB
testcase_09 AC 26 ms
24,264 KB
testcase_10 AC 27 ms
23,520 KB
testcase_11 AC 27 ms
23,880 KB
testcase_12 AC 27 ms
23,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>
#define L64 long long
#define MOD (1000000007LL)

int main(void)
{
  int all0, retnum;
  char retstr[100];
  // std::string retstr;
  std::cout << "0000000000" << std::endl;
  std::cin >> all0 >> retstr;
  if(all0 == 10){
    return 0;
  }
  int result[10];
  for (int i = 1; i <= 10; i++){
    for(int k = 1; k <= 9; k++){
      for (int j = 1; j < i; j++){
        std::cout << "0";
      }
      std::cout << k;
      for (int j = i + 1; j <= 10; j++){
        std::cout << "0";
      }
      std::cout << std::endl;
      std::cin >> retnum >> retstr;
      if(retnum == 10){
        return 0;
      } else if(all0 < retnum){
        result[i - 1] = k;
        break;
      } else if(retnum < all0){
        result[i - 1] = 0;
        break;
      }
    }
  }
  for (int i = 0; i < 10; i++){
    std::cout << result[i];
  }
  std::cout << std::endl;
  std::cin >> retnum >> retstr;
}
0