Pagini recente » Borderou de evaluare (job #585241) | Borderou de evaluare (job #686848) | Borderou de evaluare (job #475558) | Borderou de evaluare (job #427303) | Borderou de evaluare (job #2768700)
Borderou de evaluare (job #2768700)
Raport evaluator
Compilare:
main.cpp: In function 'int main()':
main.cpp:4:327: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
using namespace std;ifstream f("ttg.in");ofstream g("ttg.out");vector<pair<int,int>> t;map<int,int,greater<int>>c;int main(){int m,i,n,z,x,l;map<int,int>::iterator p,q;f>>m>>n;for(i=0;i<m;i++){f>>z;l=-1;while(z--){f>>x;if(l>x)t.push_back({l,x});l=x;}}sort(t.begin(),t.end(),greater<pair<int,int>>());c[t[0].s]=t[0].f;for(i=1;i<t.size();i++){p=c.lower_bound(t[i].f);q=c.lower_bound(t[i].s);if(q==c.end())c[t[i].s]=max(p->s,t[i].f);}while(n--){f>>x;g<<max(x,c.lower_bound(x)->s)<<'\n';}}
~^~~~~~~~~
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 147ms | 1826kb | OK | 10 |
2 | 129ms | 1433kb | OK | 10 |
3 | 58ms | 1179kb | OK | 10 |
4 | 73ms | 1179kb | OK | 10 |
5 | 114ms | 1433kb | OK | 10 |
6 | 118ms | 1302kb | OK | 10 |
7 | 52ms | 782kb | OK | 10 |
8 | 52ms | 782kb | OK | 10 |
9 | 142ms | 1826kb | OK | 10 |
10 | 113ms | 1826kb | OK | 10 |
Punctaj total | 100 |