結果
| 問題 |
No.2142 Segment Zero
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-03 01:43:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 495 bytes |
| コンパイル時間 | 1,956 ms |
| コンパイル使用メモリ | 191,400 KB |
| 最終ジャッジ日時 | 2025-02-09 04:37:42 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 19 WA * 16 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main () {
ll N, K;
cin >> N >> K;
K = (N * (N + 1)) / 2 - K;
K *= 2;
for (ll x = 1; x * x <= K; x ++) {
if (K % x) {
continue;
}
ll y = K / x;
if ((x + y) % 2 == 0) {
continue;
}
ll a = (y + (x - 1)) / 2, b = (y - (x - 1)) / 2;
if (1 <= b && a <= N) {
cout << 1 << endl;
}
}
cout << 2 << endl;
}