1 条题解
-
-1
#include <bits/stdc++.h>//下面两个头文件是IDE自己加上去的,可忽略 #include <algorithm> #include <functional> #define int long long //不开long long见祖宗 #pragma Mingw - GCC optimize(3) using namespace std; vector<int> vec, vec0; signed main() { int n; scanf("%lld", &n); for (int i = 1; i <= n; ++i) { int t; scanf("%lld", &t); vec.push_back(t); } int before; bool flag = false; for (auto i : vec) { if (flag == 0) { before = i; flag = 1; continue; } int t = abs(i - before); before = i; vec0.push_back(t); } sort(vec0.begin(), vec0.end()); if (vec0.size() != vec0.back()) { printf("Not jolly\n"); return 0; } printf("Jolly"); return 0; }
信息
- ID
- 5210
- 时间
- 1000ms
- 内存
- 125MiB
- 难度
- 1
- 标签
- 递交数
- 81
- 已通过
- 34
- 上传者