問題一覧 > 通常問題

No.413 +5,000,000pts

レベル : / AI推定難易度 : 1000 / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 71
作問者 : yuppe19 😺 / テスター : 37zigen
お気に入りにしたユーザー ProblemId : 1175 / 自分の提出
問題文最終更新日: 2021-09-13 17:07:02
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 146 (順位表) の他の問題:

Problem Statement

The following problem was given in a programming contest.
Given a positive integer $d$, find the maximum integer $t$ satisfying $t^{2} + t \le d$.
・$1 \le d \le 10^{18}$

You took part in the contest and found the following solution by another participant, written in 64ビット C++11 (C++11 as run on yukicoder).
(It seems that it does not behave as intended in a 32-bit environment.)
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll calc(ll d) {
  return (ll)((-1 + sqrt(1 + 4*d)) / 2.0);
}

int main() {
  ll d; cin >> d;
  ll t = calc(d);
  cout << t << endl;
  return 0;
}

You thought that a well-chosen challenge against this code would succeed (that is, you could find a test case on which it fails).
Generate 100,000 test cases for which the challenge succeeds.
※100,000 $= 10^{5} = 100000$

Input

This problem has no input.

Output

Output 100,000 values of $d$ for which the challenge succeeds, one per line, and print a newline at the end.
The judge works as follows:
・It reads from the 1st through the 100,000th value. The behavior is undefined if there are fewer than 100,000 values.
・If, among the 100,000 values, "there are duplicate values of $d$", "there is a $d$ not within the valid range", or "there is a challenge that fails", the judge returns Wrong Answer (WA) in each of these cases.

Sample Output

Output the numbers in the following format.
19980604
19980727
19980904
19980930
19981114
19981123
.
.
.
20000507
20010625
The values shown here are only meant to illustrate the output format and are not necessarily correct answers.
Output 100,000 lines in total.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。