Monitorul de evaluare
Meniu |
---|
Pagina problemei |
Ajutor |
- Problemă:
- Numere2
- Stare:
- Evaluat
- Dată:
- 2016-02-28 19:02:13
- Limbaj:
- C++
- Rundă:
- Arhiva
Raport teste
Nr test
Timp execuţie
Memorie folosită
Mesaj
Punctaj / test
0
3 ms
168 kb
Incorect
0 pc
1
2 ms
164 kb
Incorect
0 pc
2
4 ms
172 kb
Incorect
0 pc
3
1 ms
168 kb
Incorect
0 pc
4
3 ms
168 kb
Incorect
0 pc
5
1 ms
172 kb
Incorect
0 pc
6
1 ms
168 kb
Incorect
0 pc
7
1 ms
172 kb
Incorect
0 pc
8
1 ms
168 kb
Incorect
0 pc
9
1 ms
168 kb
Incorect
0 pc
Punctaj total:
0 pc
Erori de compilare
Nu există erori
Sursă
#include <iostream>
#include <fstream>
using namespace std;
int n,a[250000],mini,maxi,i,x;
bool q=false;
int main()
{
ifstream fin("numere2.in");
ofstream fout("numere.out");
fin>>n;
for(i=1;i<=n*n;i++){
fin>>x;
a[x]=x;
}
/* for(i=1;i<=n*n;i++)
fout<<a[i]<<" ";*/
for(i=1;i<=n*n && q==false;i++){
if(a[i]==0){
mini=a[i-1]+1;
q=true;
while(a[i]==0)
i++;
}
maxi=a[i]-1;
}
fout<<mini<<" "<<maxi;
return 0;
}
Nr test | Timp execuţie | Memorie folosită | Mesaj | Punctaj / test |
---|---|---|---|---|
0 | 3 ms | 168 kb | Incorect | 0 pc |
1 | 2 ms | 164 kb | Incorect | 0 pc |
2 | 4 ms | 172 kb | Incorect | 0 pc |
3 | 1 ms | 168 kb | Incorect | 0 pc |
4 | 3 ms | 168 kb | Incorect | 0 pc |
5 | 1 ms | 172 kb | Incorect | 0 pc |
6 | 1 ms | 168 kb | Incorect | 0 pc |
7 | 1 ms | 172 kb | Incorect | 0 pc |
8 | 1 ms | 168 kb | Incorect | 0 pc |
9 | 1 ms | 168 kb | Incorect | 0 pc |
Punctaj total: | 0 pc |
Erori de compilare
Nu există erori
Sursă
#include <iostream> #include <fstream> using namespace std; int n,a[250000],mini,maxi,i,x; bool q=false; int main() { ifstream fin("numere2.in"); ofstream fout("numere.out"); fin>>n; for(i=1;i<=n*n;i++){ fin>>x; a[x]=x; } /* for(i=1;i<=n*n;i++) fout<<a[i]<<" ";*/ for(i=1;i<=n*n && q==false;i++){ if(a[i]==0){ mini=a[i-1]+1; q=true; while(a[i]==0) i++; } maxi=a[i]-1; } fout<<mini<<" "<<maxi; return 0; }