璟雯院

珺璟如晔,雯华若锦

用户工具

站点工具


icpc:problems:luogup1233

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

icpc:problems:luogup1233 [2024/03/26 02:51] – 创建 温婕莺icpc:problems:luogup1233 [2024/03/26 02:51] (当前版本) 温婕莺
行 8: 行 8:
  
 <code c++> <code c++>
-#include<cstdio+#include <algorithm
-#include<algorithm>+#include <cstdio>
 using namespace std; using namespace std;
  
-struct node{+struct node {
     int l, w;     int l, w;
 }; };
行 24: 行 24:
     int n;     int n;
     scanf("%d", &n);     scanf("%d", &n);
-    for(int i=1; i<=n; i++)+    for (int i = 1; i <= n; i++)
         scanf("%d %d", &line[i].l, &line[i].w);         scanf("%d %d", &line[i].l, &line[i].w);
-    sort(line+1, line+1+n, cmp); +    sort(line + 1, line + 1 + n, cmp); 
-    for(int i=1; i<=n; i++) { +    for (int i = 1; i <= n; i++) { 
-        for(int j=i-1; j>=1; j--) +        for (int j = i - 1; j >= 1; j--) 
-            if(line[j].w > line[i].w)+            if (line[j].w > line[i].w)
                 f[i] = max(f[i], f[j] + 1);                 f[i] = max(f[i], f[j] + 1);
     }     }
     int ans = 0;     int ans = 0;
-    for(int i=1; i<=n; i++)+    for (int i = 1; i <= n; i++)
         ans = max(ans, f[i]);         ans = max(ans, f[i]);
-    printf("%d", ans+1);+    printf("%d", ans + 1);
     return 0;     return 0;
 } }
/app/www/public/data/pages/icpc/problems/luogup1233.txt · 最后更改: 2024/03/26 02:51 由 温婕莺