F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_23318289_15577.cpp:1:848: fatal error: GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stdc++.h>usin: Invalid argument
 /*hdu6098[RMQ+绛涙硶] 2017澶氭牎6*/#include <bits/stdc++.h>using namespace std;int T, n, st[100005][20], len[100005], a[100005];void st_init() {len[0] = -1;for (int i = 1; i <= n; i++) {st[i][0] = a[i];len[i] = (i & (i - 1)) == 0 ? len[i - 1] + 1 : len[i - 1];}for (int j = 1; j <= len[n]; j++) {for (int i = 1; i + (1 << j) - 1 <= n; i++) {st[i][j] = max(st[i][j - 1], st[i + (1 << (j - 1))][j - 1]);}}}int query(int l, int r) {int k = len[r - l + 1];return max(st[l][k], st[r - (1 << k) + 1][k]);}int main() {scanf("%d", &T);while (T--) {scanf("%d", &n);for (int i = 1; i <= n; i++) {scanf("%d", &a[i]);}st_init();for (int i = 2; i <= n; i++) {int ans = 0;for (int j = 0; j < n; j += i) {//cout<<"["<<j+1<<", "<<min(n, j + i - 1)<<"]\n";ans = max(query(j + 1, min(n, j + i - 1)), ans);}if(i>2) printf(" ");printf("%d", ans);}puts("");}return 0;}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ^
compilation terminated.


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-26 14:51:22, Gzip enabled