Show all threads Hide all threads Show all messages Hide all messages | Test #30 removed | Vladimir Yakovlev (USU) | 1522. Factory | 12 Oct 2022 03:15 | 1 | Test #30 was found to be incorrect. It has been removed. The failing solutions have been rejudged. | Why is my solution WA#30? | hyman00 | 1522. Factory | 7 Apr 2022 19:20 | 1 | #include <bits/stdc++.h> #define pb push_back #define mp make_pair #define sz(a) ((int)a.size()) #define re return #define all(a) a.begin(),a.end() #define int long long #define rept(i,a,b) for(int i=(a);i<(b);i++) #define rep(i,a) rept(i,0,a) #define vi vector<int> #define pii pair<int,int> #define F first #define S second using namespace std; const int MOD=1000000007,INF=1000000000000000000; template<typename T>inline void Mx(T &a,T b){a=max(a,b);} template<typename T>inline void Mi(T &a,T b){a=min(a,b);} inline int ad(int &a,int b,int c=MOD){re a=(a+b)%c;} template<typename T>inline T read(){T a;cin>>a;re a;} inline bool is_digit(int msk,int d){re (msk>>d)&1;} const int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1}; struct thing{int a,b,c,id;}p[100005]; bool operator<(thing a,thing b){ int p=a.a+b.c+max(a.b+a.c,b.a+b.b); int q=b.a+a.c+max(b.b+b.c,a.a+a.b); if(p==q)re a.a<b.a; re p<q; } int n; void run(){ cin>>n; rep(i,n)cin>>p[i].a>>p[i].b>>p[i].c,p[i].id=i+1; sort(p,p+n); int a=0,b=0,c=0; rep(i,n){ a=a+p[i].a; b=max(a,b)+p[i].b; c=max(b,c)+p[i].c; } cout<<c<<"\n"; rep(i,n)cout<<p[i].id<<" "; cout<<"\n"; } signed main() { // ios::sync_with_stdio(0); // cin.tie(0);cout.tie(0); // for(int tc=read<int>();tc;tc--) run(); re 0; } | If you WA30, try to use Visual Studio C++ | Hyperhydrochloric Acid | 1522. Factory | 23 Apr 2021 12:52 | 1 | This will make your program accepted. I've tried it. | First Place. 0.046 s. | xurshid_n | 1522. Factory | 7 Nov 2015 14:48 | 2 | | I'm so enchanted to the problem. It's amazing | Marshall Mathers | 1522. Factory | 20 May 2011 12:38 | 1 | The process to prove it is both easy and creative. Sort all the numbers in the following way: ^ |a<c: sort them according to its value of A+B in increasing order | |a=c: you may sort them arbitrarily | |a>c: sort them according to its value of B+C in decreasing order | | amazing!-1522 | svr | 1522. Factory | 3 Feb 2009 09:59 | 1 | I made absolute standard algo for 3-machine scheduling with dominated one of machine and took 1 place in problem rating! How can it be if so many top programmers presence in this list. Also: qsort() from stdlib.h didn't give chance go far then WA12. I used old, kind my qsort and got AC immediately. Edited by author 03.02.2009 10:03 | Is it a knapsack problem? | Jerry | 1522. Factory | 19 Aug 2008 17:45 | 2 | Is it a knapsack problem? No, it's an optimal scheduling problem | TEST 12 WA ???? | LyXuanSang | 1522. Factory | 6 Oct 2007 20:24 | 1 | I can't pass TEST 12 . Why??? Please send me Test 12 | wrong constraints | Kit | 1522. Factory | 25 Mar 2007 22:26 | 2 | Test #18 has numbers greater then 1000000, as mentioned in other thread, so problem's description (or tests) still need to be corrected. Edited by author 24.03.2007 01:02 | WA12????????? | RAVEman | 1522. Factory | 7 Mar 2007 23:18 | 1 | what is that test? none of my solutions can pass it. Please give me some hints!!! | Error in judge? | MessedUp | 1522. Factory | 22 Feb 2007 17:09 | 5 | When I submit the program with the comparison function shown below, I get WA 27. But if I use a similar comparison function as bruce described in the other topic, i get AC. What's weird is that both result in the same answer (I assert-ed this), but maybe different permutations. So unless my evaluation function (also shown below) is wrong, the judge does not accept all valid permutations. ll calc() { ll ca=0,cb=0,cc=0; REP(i,n) { ca+=x[i].a; cb=max(ca,cb)+x[i].b; cc=max(cb,cc)+x[i].c; } return cc; } typedef struct cmp2 { bool operator() (const X &x,const X &y) { return min(y.a+y.b,x.b+x.c)>min(x.a+x.b,y.b+y.c); } } cmp2; Edited by author 19.02.2007 05:37 I initially used exactly this function, but I realised that it's not a strict weak ordering: consider the toys 1 0 1, 1 0 2 and 2 0 1 (call them p, q, r). Then p === q (I use === to mean not less than or greater than), p === r, but q < r. Can you tell me exactly how you formulated your function that was based on mine? Even after fixing an I/O problem I'm still getting WA #18 for this. Hmmm, it is indeed not a strict weak ordering. I assumed it was, because http://ace.delos.com/OPEN06anal/mqueue.html says it is. (by the way, you wrote that. I should never trust you :P) Anyway, that does not change the fact that both comparisons I use gave the correct final time (as assert-ed), but only one of the generated orderings is accepted. So either my evaluation function of an ordering is wrong, or the judge is wrong (I also assert-ed that each of the nr's was present in the final ordering, so it can't go wrong because stl assumes it is a strict weak ordering, I think). Finally, my AC solution uses this: typedef struct cmp1 { bool operator() (const X &x,const X &y) { return x.v<y.v; } } cmp1; and REP(i,n) { int p=x[i].a+x[i].b,q=x[i].b+x[i].c; x[i].v=p<q?p:INT_MAX-q; } Yes, it was only during this contest I realised that the original comparator wasn't a strict weak ordering. It appears that test case 18 exceeds the stated bounds on A, B and C, which was causing the problems. I now get AC using your comparison function (which is the same one I was trying during the contest, but I got screwed by the non-C99 printf. I've also been screwed by that strange %I64d, as well as by the absence of <?=, >?=, __typeof and probably several others as well. | Evaluator requires a trailing space | Bruce Merry | 1522. Factory | 22 Feb 2007 17:08 | 7 | I carefully wrote my solution to not put any extraneous spaces at the end of the second line and it came back WA #1 every time during the contest. If I now put a space at the end of the line, it comes back as WA #12. Argh! Eight years later and we still don't have C99-compliant compilers. I now get WA #18 but presumably that is a different issue. wrong thread Edited by author 22.02.2007 17:08 ??? again. Confusing that the order of the threads changes if you post a solution in the wrong thread, and then want to correct it by going to the other thread. :) Edited by author 22.02.2007 17:08 Edited by author 22.02.2007 17:10 |
|
|