确定题目数据没错?

P1152 欢乐的跳

被样例坑了。。。 样例是3,2,1 然后我就以为它是下降序列 \_(我在某网站做的就是下降序列)\_
by Stella_Yan @ 2017-10-25 18:43:14


找到坑后我也过了 (以后千万别相信样例)
by Stella_Yan @ 2017-10-25 18:48:58


@[极影兔](/space/show?uid=56565) ###总结出一点: #**样例可以煮成汤喝!!!**
by wisdom_grass @ 2017-10-25 20:08:31


```cpp ublic class Main { public static void main(String[] args) { // TODO Auto-generated method stub int a[]; int c[]; Scanner sr=new Scanner(System.in); int n=sr.nextInt(); a=new int[n]; c=new int[n-1]; for (int i = 0; i < n; i++) { a[i] = sr.nextInt(); if (i>=1) { c[i-1]=Math.abs(a[i]-a[i-1]); } } for (int i = 1; i < c.length; i++) { int insertVal=c[i]; int index=i-1; while(index>=0&&insertVal<c[index]){ c[index+1]=c[index]; index--; } c[index+1]=insertVal; } for (int i = 0; i < c.length; i++) { if(c[i]==i+1){ if(i==c.length-1) System.out.println("Jolly"); }else{ System.out.println("Not jolly"); break; } } } } 表示不需要把数组长度写死 ```
by qi_f @ 2017-12-13 20:31:32


不要随便质疑洛谷的每一道题,除非某一题一个人都没有过.
by ZJH365 @ 2018-02-21 19:27:44


``` @[kkksc03](/space/show?uid=1) 站长团 2017-10-25 12:40 回复 不要tmd随便质疑数百人通过的题目。 ``` 这是站长团的名人名言
by ZJH365 @ 2018-02-21 19:29:42


上一页 |