fork download
  1. make(int, n);
  2. RE (i, n) {
  3. cin>>l[i]>>a[i];
  4. }
  5. RE (ver, n) {
  6. RE (hor, n) {
  7. a[hor] -= 2;
  8. a[ver] -= 2;
  9. int h = l[ver];
  10. int cur_wid = 0;
  11. int taken = 0;
  12. if (a[hor] < 0 || a[ver] < 0 || (hor != n && ver != n)) {
  13. goto A;
  14. }
  15. RE (now, n) {
  16. if (now == ver || a[now] == 0) { continue; }
  17. if (h == 1) { goto A; }
  18. int bl = (a[now] + h - 2) / (h - 1);
  19. cur_wid += bl * l[now];
  20. a[ver] -= bl;
  21. taken += bl;
  22. }
  23. if (cur_wid == l[hor]) {
  24. taken--;
  25. a[ver]++;
  26. }
  27. if (a[ver] < 0 || a[ver] > l[hor] - cur_wid - (a[ver] != 0)) {
  28. goto A;
  29. }
  30. cout<<"YES\n";
  31. debug3(hor, ver, cur_wid);
  32. return 0;
  33. A: ;
  34. a[hor] += 2;
  35. a[ver] += 2;
  36. a[ver] += taken;
  37. }
  38. }
  39. cout<<"NO\n";
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:13: error: 'n' has not been declared
   make(int, n);
             ^
prog.cpp:1:15: error: expected constructor, destructor, or type conversion before ';' token
   make(int, n);
               ^
prog.cpp:2:6: error: expected constructor, destructor, or type conversion before '(' token
   RE (i, n) {
      ^
prog.cpp:5:6: error: expected constructor, destructor, or type conversion before '(' token
   RE (ver, n) {
      ^
stdout
Standard output is empty