結果

問題 No.1058 素敵な数
ユーザー kng_kng_
提出日時 2020-05-22 21:53:53
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 882 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 63,532 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 16:39:49
合計ジャッジ時間 1,124 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  int 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