点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 金牌教程 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From sina007
序列的单调性
背景 Background
  为了for beginngers,特设此题,^_^
描述 Description
  序列的单调性
题目正文
输入一个由n个整数组成的序列,其中序列中任意连续三个整数都互不相同,求该序列中所有递增或递减子序列的个数。
输入格式 Input Format
第1行:只有一个数n(2≤n≤10000)。
第2行:共n个数(每个数均小于1000)
输出格式 Output Format
第1..?行:每行为一个满足条件的子序列;
最后一行:递增或递减子序列的个数。
样例输入 Sample Input
10
1 10 8 5 9 3 2 6 7 4
样例输出 Sample Output
1 10   
10 8 5 
5 9
9 3 2
2 6 7
7 4
6  

输入格式 Input Format
  第1行:只有一个数n(2≤n≤10000)。
第2行:共n个数(每个数均小于1000)
输出格式 Output Format
  第1..?行:每行为一个满足条件的子序列;
最后一行:递增或递减子序列的个数。
样例输入 Sample Input
 
样例输出 Sample Output
 
时间限制 Time Limitation
  各个测试点1s
注释 Hint
  Free Pascal Code:
-------------------
program Plus;
var a,b:longint;
begin
 readln(a,b);
 writeln(a+b);
end.

C++ Code:
-------------------
#include <iostream>
using namespace std;
int main(){
 int a,b;
 cin>>a>>b;
 cout<<a+b<<endl;
 return 0;
}
Flag
  
题号
  P1641
  模拟
通过
  2人
提交
  8次
通过率
  25%
难度
  1
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1253 | Online Users / Processes : 0 / 164 | Processed Time : 94 ms | Server Time : 2025/7/1 20:09:40