Pagini recente » Borderou de evaluare (job #2292628) | Borderou de evaluare (job #2952689) | Borderou de evaluare (job #900884) | Borderou de evaluare (job #2723628) | Borderou de evaluare (job #1546660)
Borderou de evaluare (job #1546660)
Raport evaluator
Compilare:
user.cpp: In function ‘int main()’:
user.cpp:2:92: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
using namespace std;bitset <32> b;char s[5000010];int main(){freopen("subbit.in","r",stdin);freopen("subbit.out","w",stdout);int nrb=1,wb=1,nr=0,used=0;gets(s);for(int x=0;s[x];x++){s[x]-='0';do{wb--;if(wb==-1){used+=nrb;nr++;b=nr;if(nr>1&&b.count()==1)nrb++;wb=nrb-1;}}while(b[wb]!=s[x]);}printf("%d",used+nrb-wb);return 0;}
^
user.cpp:2:125: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
using namespace std;bitset <32> b;char s[5000010];int main(){freopen("subbit.in","r",stdin);freopen("subbit.out","w",stdout);int nrb=1,wb=1,nr=0,used=0;gets(s);for(int x=0;s[x];x++){s[x]-='0';do{wb--;if(wb==-1){used+=nrb;nr++;b=nr;if(nr>1&&b.count()==1)nrb++;wb=nrb-1;}}while(b[wb]!=s[x]);}printf("%d",used+nrb-wb);return 0;}
^
user.cpp:2:160: warning: ignoring return value of ‘char* gets(char*)’, declared with attribute warn_unused_result [-Wunused-result]
using namespace std;bitset <32> b;char s[5000010];int main(){freopen("subbit.in","r",stdin);freopen("subbit.out","w",stdout);int nrb=1,wb=1,nr=0,used=0;gets(s);for(int x=0;s[x];x++){s[x]-='0';do{wb--;if(wb==-1){used+=nrb;nr++;b=nr;if(nr>1&&b.count()==1)nrb++;wb=nrb-1;}}while(b[wb]!=s[x]);}printf("%d",used+nrb-wb);return 0;}
^
/tmp/ccOJq0o8.o: In function `main':
user.cpp:(.text.startup+0x56): warning: the `gets' function is dangerous and should not be used.
| Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
| 1 | 0ms | 416kb | OK | 5 |
| 2 | 0ms | 420kb | OK | 5 |
| 3 | 0ms | 424kb | OK | 5 |
| 4 | 0ms | 436kb | OK | 5 |
| 5 | 0ms | 516kb | OK | 5 |
| 6 | 0ms | 516kb | OK | 5 |
| 7 | 0ms | 520kb | OK | 5 |
| 8 | 24ms | 1400kb | OK | 5 |
| 9 | 28ms | 1396kb | OK | 5 |
| 10 | 28ms | 1400kb | OK | 5 |
| 11 | 0ms | 424kb | OK | 5 |
| 12 | 0ms | 416kb | OK | 5 |
| 13 | 0ms | 424kb | OK | 5 |
| 14 | 28ms | 1396kb | OK | 5 |
| 15 | 24ms | 1396kb | OK | 5 |
| 16 | 52ms | 2372kb | OK | 5 |
| 17 | 136ms | 5296kb | OK | 5 |
| 18 | 132ms | 5300kb | OK | 5 |
| 19 | 124ms | 5300kb | OK | 5 |
| 20 | 124ms | 5304kb | OK | 5 |
| Punctaj total | 100 |