Pagini recente » Borderou de evaluare (job #1270925) | Borderou de evaluare (job #904196) | Borderou de evaluare (job #2975733) | Borderou de evaluare (job #2698047) | Borderou de evaluare (job #2278615)
Borderou de evaluare (job #2278615)
Raport evaluator
Compilare:
main.cpp: In function 'int main()':
main.cpp:2:108: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
using namespace std;char v[1000000],st[1000000];int main(){int n,m,c,i,x=1;freopen("trompeta.in","r",stdin);freopen("trompeta.out","w",stdout);scanf("%d%d\n", &n, &m);for (i=1;i<=n;i++)v[i]=fgetc(stdin);st[1]=v[1];c=n-m;for (i=2;i<=n;st[++x]=v[i],i++)while (c!=0 && x!=0 && v[i]-'0'>st[x]-'0')c--,x--;printf("%s", st+1);return 0;}
^
main.cpp:2:143: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
using namespace std;char v[1000000],st[1000000];int main(){int n,m,c,i,x=1;freopen("trompeta.in","r",stdin);freopen("trompeta.out","w",stdout);scanf("%d%d\n", &n, &m);for (i=1;i<=n;i++)v[i]=fgetc(stdin);st[1]=v[1];c=n-m;for (i=2;i<=n;st[++x]=v[i],i++)while (c!=0 && x!=0 && v[i]-'0'>st[x]-'0')c--,x--;printf("%s", st+1);return 0;}
^
main.cpp:2:167: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
using namespace std;char v[1000000],st[1000000];int main(){int n,m,c,i,x=1;freopen("trompeta.in","r",stdin);freopen("trompeta.out","w",stdout);scanf("%d%d\n", &n, &m);for (i=1;i<=n;i++)v[i]=fgetc(stdin);st[1]=v[1];c=n-m;for (i=2;i<=n;st[++x]=v[i],i++)while (c!=0 && x!=0 && v[i]-'0'>st[x]-'0')c--,x--;printf("%s", st+1);return 0;}
^
| Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
| 1 | 2ms | 131kb | OK | 10 |
| 2 | 2ms | 131kb | OK | 10 |
| 3 | 2ms | 131kb | OK | 10 |
| 4 | 2ms | 131kb | OK | 10 |
| 5 | 2ms | 131kb | OK | 10 |
| 6 | 6ms | 262kb | OK | 10 |
| 7 | 6ms | 262kb | OK | 10 |
| 8 | 34ms | 2228kb | OK | 10 |
| 9 | 29ms | 3014kb | OK | 10 |
| 10 | 33ms | 2359kb | OK | 10 |
| Punctaj total | 100 |