/ Vijos /

记录详情

Compile Error

/in/foo.cc:1:21: warning: extra tokens at end of #include directive
 #include <iostream> using namespace std; const int N = 100;int a[N], dp[N], n; int lis(int n){    int res = 0;     for(int i=0; i<n; i++) {        dp[i] = 1;        for(int j=0; j<i; j++)            if(a[j] < a[i])                dp[i] = max(dp[i], dp[j] + 1);        res = max(res, dp[i]);    }    return res;} int lds(int n){    int res = 0;     for(int i=0; i<n; i++) {        dp[i] = 1;        for(int j=0; j<i; j++)            if(a[j] > a[i])                dp[i] = max(dp[i], dp[j] + 1);        res = max(res, dp[i]);    }    return res;} int main(){    char ch;     n = 0;    while(scanf("%d%c", &a[n++], &ch))         if(ch == '\n')             break;     int ans1 = lds(n);    cout << ans1 << "," << lis(n) - 1 << endl;     return 0;}
                     ^~~~~
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

信息

递交者
类型
递交
题目
P2056 连续子序列
语言
C++
递交时间
2019-12-26 11:05:50
评测时间
2019-12-26 11:05:50
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes