結果

問題 No.634 硬貨の枚数1
ユーザー しらっ亭しらっ亭
提出日時 2017-05-10 16:20:58
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 350 bytes
コンパイル時間 375 ms
コンパイル使用メモリ 61,868 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 18:18:30
合計ジャッジ時間 2,556 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 2 ms
4,380 KB
testcase_45 WA -
testcase_46 AC 2 ms
4,376 KB
testcase_47 AC 2 ms
4,376 KB
testcase_48 AC 1 ms
4,376 KB
testcase_49 AC 1 ms
4,376 KB
testcase_50 WA -
testcase_51 AC 1 ms
4,380 KB
testcase_52 AC 2 ms
4,376 KB
testcase_53 WA -
testcase_54 AC 1 ms
4,376 KB
testcase_55 AC 1 ms
4,380 KB
testcase_56 AC 1 ms
4,376 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 2 ms
4,376 KB
testcase_60 AC 1 ms
4,380 KB
testcase_61 AC 1 ms
4,376 KB
testcase_62 AC 1 ms
4,376 KB
testcase_63 AC 1 ms
4,376 KB
testcase_64 AC 1 ms
4,376 KB
testcase_65 AC 2 ms
4,380 KB
testcase_66 AC 1 ms
4,376 KB
testcase_67 AC 2 ms
4,380 KB
testcase_68 AC 1 ms
4,376 KB
testcase_69 AC 1 ms
4,380 KB
testcase_70 WA -
testcase_71 AC 1 ms
4,384 KB
testcase_72 WA -
testcase_73 AC 2 ms
4,376 KB
testcase_74 AC 2 ms
4,380 KB
testcase_75 AC 1 ms
4,380 KB
testcase_76 WA -
testcase_77 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// 想定WA解法(OEIS)
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int solve(int n) {

  vector<int> T;
  for (int t, i = 1; (t = i * (i + 1) / 2) <= n; i++) {
    if (t == n) return 1;
  }
  if (n % 9 == 5 || n % 9 == 8) return 3;
  return 2;
}

int main() {
  int n;
  cin >> n;
  cout << solve(n) << endl;
}
0