Pagini recente » Borderou de evaluare (job #2335717) | Borderou de evaluare (job #298908) | Borderou de evaluare (job #995266) | Borderou de evaluare (job #1865305) | Borderou de evaluare (job #1694978)
Borderou de evaluare (job #1694978)
Raport evaluator
Compilare:
user.cpp: In function ‘int main()’:
user.cpp:2:90: 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:123: 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:158: 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/cc2vOfgG.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 | 420kb | OK | 5 |
2 | 0ms | 420kb | OK | 5 |
3 | 0ms | 428kb | OK | 5 |
4 | 0ms | 428kb | OK | 5 |
5 | 0ms | 520kb | OK | 5 |
6 | 0ms | 524kb | OK | 5 |
7 | 0ms | 524kb | OK | 5 |
8 | 24ms | 1392kb | OK | 5 |
9 | 24ms | 1392kb | OK | 5 |
10 | 24ms | 1396kb | OK | 5 |
11 | 0ms | 420kb | OK | 5 |
12 | 0ms | 424kb | OK | 5 |
13 | 0ms | 424kb | OK | 5 |
14 | 24ms | 1392kb | OK | 5 |
15 | 24ms | 1396kb | OK | 5 |
16 | 52ms | 2380kb | OK | 5 |
17 | 136ms | 5300kb | OK | 5 |
18 | 132ms | 5300kb | OK | 5 |
19 | 124ms | 5304kb | OK | 5 |
20 | 128ms | 5300kb | OK | 5 |
Punctaj total | 100 |