- 老爷爷与老奶奶
- 2016-12-18 17:05:52 @
记录信息
评测状态 Wrong Answer
题目 P1925 老爷爷与老奶奶
递交时间 2016-12-18 17:00:25
代码语言 C++
评测机 ShadowShore
消耗时间 2553 ms
消耗内存 956 KiB
评测时间 2016-12-18 17:00:30
评测结果
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #1: Accepted, time = 15 ms, mem = 956 KiB, score = 2
测试数据 #2: WrongAnswer, time = 0 ms, mem = 952 KiB, score = 0
测试数据 #3: Accepted, time = 109 ms, mem = 952 KiB, score = 2
测试数据 #4: Accepted, time = 140 ms, mem = 952 KiB, score = 2
测试数据 #5: Accepted, time = 140 ms, mem = 952 KiB, score = 2
测试数据 #6: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #7: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #8: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #9: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #10: Accepted, time = 140 ms, mem = 952 KiB, score = 2
测试数据 #11: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #12: Accepted, time = 140 ms, mem = 952 KiB, score = 2
测试数据 #13: Accepted, time = 156 ms, mem = 952 KiB, score = 2
测试数据 #14: Accepted, time = 171 ms, mem = 952 KiB, score = 2
测试数据 #15: Accepted, time = 156 ms, mem = 952 KiB, score = 2
测试数据 #16: Accepted, time = 140 ms, mem = 952 KiB, score = 2
测试数据 #17: Accepted, time = 125 ms, mem = 952 KiB, score = 2
测试数据 #18: Accepted, time = 140 ms, mem = 956 KiB, score = 2
测试数据 #19: Accepted, time = 140 ms, mem = 956 KiB, score = 2
测试数据 #20: Accepted, time = 0 ms, mem = 956 KiB, score = 2
测试数据 #21: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #22: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #23: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #24: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #25: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #26: Accepted, time = 0 ms, mem = 956 KiB, score = 2
测试数据 #27: WrongAnswer, time = 0 ms, mem = 952 KiB, score = 0
测试数据 #28: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #29: Accepted, time = 0 ms, mem = 956 KiB, score = 2
测试数据 #30: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #31: WrongAnswer, time = 15 ms, mem = 948 KiB, score = 0
测试数据 #32: WrongAnswer, time = 15 ms, mem = 952 KiB, score = 0
测试数据 #33: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #34: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #35: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #36: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #37: WrongAnswer, time = 0 ms, mem = 952 KiB, score = 0
测试数据 #38: WrongAnswer, time = 0 ms, mem = 948 KiB, score = 0
测试数据 #39: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #40: Accepted, time = 78 ms, mem = 952 KiB, score = 2
测试数据 #41: WrongAnswer, time = 15 ms, mem = 952 KiB, score = 0
测试数据 #42: WrongAnswer, time = 0 ms, mem = 952 KiB, score = 0
测试数据 #43: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #44: Accepted, time = 93 ms, mem = 952 KiB, score = 2
测试数据 #45: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #46: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #47: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #48: Accepted, time = 0 ms, mem = 952 KiB, score = 2
测试数据 #49: Accepted, time = 0 ms, mem = 952 KiB, score = 2
WrongAnswer, time = 2553 ms, mem = 956 KiB, score = 84
代码
#include <iostream>
using namespace std;
int main()
{
int n,i,a[100001],v,Max=-1;
bool k=0;
cin>>n;
for(i=1;i<=n;i++)cin>>a[i];
for(i=1;i<=n;i++)
{
if(Max>a[i])
{
if(!k){
k=1;
Max=a[i];
v=i;
}
else{
cout<<-1;
return 0;
}
}
Max=a[i];
}
if(k)cout<<n-v+1;
else cout<<0;
return 0;
}
为何会WA???想不通