UVa 10038 Jolly Jumpers
2010-02-22 13:03
344 查看
/* coder: ACboy date: 2010-2-22 result: AC description: */ #include <iostream> using namespace std; #define MAXN 3000 + 10 int flag[MAXN]; int data[MAXN]; int main() { int i, j; int n; #ifndef ONLINE_JUDGE freopen("10038.txt", "r", stdin); #endif while (cin >> n) { for (i = 0; i < n; i++) { cin >> data[i]; } memset(flag, 0, sizeof(flag)); int ans = 1; for (i = 0; i < n - 1; i++) { if (abs(data[i + 1] - data[i]) > n - 1) { ans = 0; break;} if (flag[abs(data[i + 1] - data[i])] == 0) flag[abs(data[i + 1] - data[i])] = 1; else { ans = 0; break; } } if (ans) cout << "Jolly" << endl; else cout << "Not jolly" << endl; } return 0; }
相关文章推荐
- uva 10038 Jolly Jumpers
- uva 10038 Jolly Jumpers
- UVa 10038 / POJ 2575 / ZOJ 1879 Jolly Jumpers (water ver.)
- UVA10038 Jolly Jumpers
- UVA 10038 - Jolly Jumpers
- uva 10038 Jolly Jumpers
- UVa Problem Solution: 10038 - Jolly Jumpers
- UVa Problem 10038 Jolly Jumpers (快乐的跳跃者)
- uva 10038 - Jolly Jumpers
- UVA10038 - Jolly Jumpers
- UVa10038:Jolly Jumpers
- UVa - 10038 - Jolly Jumpers
- UVa 10038 Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- POJ2575 ZOJ1879 UVA10038 Jolly Jumpers【序列】
- uva10038 Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- UVa 10038 - Jolly Jumpers
- UVA 10038 - Jolly Jumpers
- uva 10038