|
|
вернуться в форумI think program is ok, but I got WA#1 Послано Zashi 8 апр 2011 03:26 #include<iostream> using namespace std; int main(){ int n,y=100001; int x=0; cin >> n;
int *array = new int[n];
for( int i=0; i<n; i++ ) { cin >> array[i]; }
for (int i=0; i<n; i++) { x = (array[i+1] - array[i]); if(x < y && x >= 0) { y = x; } }
cout << y; system("PAUSE"); return 0; }
---------------------------------------------------------------- Why WA#1? I got 3 for: 5 5 8 13 27 14
So? Does someone know? I think program is ok, but I got WA#1 Послано Lock 5 окт 2011 02:15 WA - Wrong Algorithm |
|
|