Submission #92641

# Submission time Handle Problem Language Result Execution time Memory
92641 2019-01-04T08:58:13 Z GioChkhaidze Money (IZhO17_money) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>
using namespace std;
int n,a[1000006],Ans=1;
main ()
{
	scanf("%d",&n);
	
	for (int i=1; i<=n; i++)
		scanf("%d",&a[i]);
		
	for (int i=2; i<=n; i++)
		if (a[i-1]>a[i]) Ans++;
	
	cout<<Ans<<endl;
}

Compilation message

money.cpp:4:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main ()
       ^
money.cpp: In function 'int main()':
money.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
money.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&a[i]);
   ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 256 KB Output isn't correct
3 Halted 0 ms 0 KB -