結果

問題 No.1058 素敵な数
ユーザー kng_kng_
提出日時 2020-05-22 21:56:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 63,812 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 16:44:12
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  long long n;
  cin >> n;
  long long v[6] = {
100003, 100019, 100043, 100049, 100057, 100069
  };
  switch (n - 1) {
    case (0):
      cout << 1;
      break;
    case (1):
      cout << v[0] * v[0];
      break;
    case (2):
      cout << v[0] * v[1];
      break;
    case (3):
      cout << v[1] * v[1];
      break;
    case (4):
      cout << v[0] * v[2];
      break;
    case (5):
      cout << v[0] * v[3]; // 7
      break;
    case (6):
      cout << v[4] * v[0]; // 9
      break;
    case (7):
      cout << v[1] * v[2]; // 6
      break;
    case (8):
      cout << v[1] * v[3]; // 8
      break;
    case (9):
      cout << v[0] * v[5]; // 11
      break;
    case (10):
      cout << v[2] * v[2]; // 10
      break;
    default:
      cout << v[1] * v[4] << endl;
      cout << v[2] * v[3] << endl;
  }
  cout << endl;
}
0