[GESP202503 三级] 2025

Luogu
IDLGB4261
Time1000ms
Memory512MB
DifficultyP1
2025枚举位运算GESP
小 A 有一个整数 $x$,他想找到最小的正整数 $y$ 使得下式成立: $$(x \ \operatorname{and} \ y) + (x \ \operatorname{or} \ y) = 2025$$ 其中 $\operatorname{and}$ 表示二进制按位与运算,$\operatorname{or}$ 表示二进制按位或运算。如果不存在满足条件的 $y$,则输出 $-1$。 ## Input 一行,一个整数 $x$。 ## Output 一行,一个整数,若满足条件的 $y$ 存在则输出 $y$,否则输出 $-1$。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1175> ## Note 对于所有测试点,保证 $0 \leq x < 2025$。 $$(x \ \operatorname{and} \ y) + (x \ \operatorname{or} \ y) = 2025$$ 其中: - $\operatorname{and}$ 表示按位与运算,运算符为 $\&$。 - $\operatorname{or}$ 表示按位或运算,运算符为 $|$。
Samples
Input #1
1025
Output #1
1000
API Response (JSON)
{
  "problem": {
    "name": "[GESP202503 三级] 2025",
    "description": {
      "content": "小 A 有一个整数 $x$,他想找到最小的正整数 $y$ 使得下式成立: $$(x \\ \\operatorname{and} \\ y) + (x \\ \\operatorname{or} \\ y) = 2025$$ 其中 $\\operatorname{and}$ 表示二进制按位与运算,$\\operatorname{or}$ 表示二进制按位或运算。如果不存在满足条件的 $y$,则输出 $-1$。 ",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB4261"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小 A 有一个整数 $x$,他想找到最小的正整数 $y$ 使得下式成立:\n\n$$(x \\ \\operatorname{and} \\ y) + (x \\ \\operatorname{or} \\ y) = 2025$$\n\n其中 $\\operatorname{and}$ 表示二进制按位与运算,$\\operatorname{or}$ 表示二进制按位或运算。如果不存在满足条件的 $y$,则输出 $-1$。\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments