1 条题解
-
0
C++ :
#include <cstdio> #include <iostream> #include <algorithm> #define rep(i,a,b) for(int i=a;i<=b;i++) #define dep(i,a,b) for(int i=a;i>=b;i--) using namespace std; typedef unsigned long long uLL; const int N = 100000; uLL a[N]; uLL F(uLL x){ uLL t = ((19 * x * x * x)+(98 * x * x))+((12 * x)+14); t = t * t * t; return t; } int ans[N]; int main(){ int n,q; scanf("%d%d",&n,&q); rep(i,1,q) scanf("%llu",&a[i]); rep(i,1,n) if (a[q] >> 26 == F(i) >> 26){ ans[q] = i; dep(i, q, 2) ans[i - 1] = a[i] ^ F(ans[i]); rep(i, 1, q) printf("%d\n",ans[i]); return 0; } return 0; }
- 1
信息
- ID
- 3239
- 时间
- 1000ms
- 内存
- 10MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者