Pagini recente » Borderou de evaluare (job #1214069) | Borderou de evaluare (job #2502730) | Borderou de evaluare (job #1410500) | Borderou de evaluare (job #1749380) | Borderou de evaluare (job #2504047)
Borderou de evaluare (job #2504047)
Raport evaluator
Compilare:
main.cpp: In function 'int main()':
main.cpp:3:85: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
const int NMAX=2*1e6-2;std::bitset<NMAX>ciur;int main(){freopen("ciur.in","r",stdin);freopen("ciur.out","w",stdout);int n;scanf("%d",&n);for(int i = 2; i * i <= n; ++i)if(!ciur[i-2])for(int j=i;i*j<=n;++j)ciur[i*j-2]=true;int cnt=0;for(int i=2;i<=n;++i)if(!ciur[i-2])++cnt;printf("%d\n",cnt);fclose(stdin);fclose(stdout);}
^
main.cpp:3:116: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
const int NMAX=2*1e6-2;std::bitset<NMAX>ciur;int main(){freopen("ciur.in","r",stdin);freopen("ciur.out","w",stdout);int n;scanf("%d",&n);for(int i = 2; i * i <= n; ++i)if(!ciur[i-2])for(int j=i;i*j<=n;++j)ciur[i*j-2]=true;int cnt=0;for(int i=2;i<=n;++i)if(!ciur[i-2])++cnt;printf("%d\n",cnt);fclose(stdin);fclose(stdout);}
^
main.cpp:3:137: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
const int NMAX=2*1e6-2;std::bitset<NMAX>ciur;int main(){freopen("ciur.in","r",stdin);freopen("ciur.out","w",stdout);int n;scanf("%d",&n);for(int i = 2; i * i <= n; ++i)if(!ciur[i-2])for(int j=i;i*j<=n;++j)ciur[i*j-2]=true;int cnt=0;for(int i=2;i<=n;++i)if(!ciur[i-2])++cnt;printf("%d\n",cnt);fclose(stdin);fclose(stdout);}
^
| Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
| 1 | 2ms | 131kb | OK | 10 |
| 2 | 3ms | 131kb | OK | 10 |
| 3 | 2ms | 131kb | OK | 10 |
| 4 | 14ms | 262kb | OK | 10 |
| 5 | 14ms | 262kb | OK | 10 |
| 6 | 28ms | 348kb | OK | 10 |
| 7 | 15ms | 262kb | OK | 10 |
| 8 | 18ms | 393kb | OK | 10 |
| 9 | 39ms | 421kb | OK | 10 |
| 10 | 40ms | 421kb | OK | 10 |
| Punctaj total | 100 |