QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#744800#5673. CornholeMattTheNub#AC ✓0ms3736kbC++232.0kb2024-11-13 23:30:012024-11-13 23:30:02

Judging History

你现在查看的是最新测评结果

  • [2024-11-13 23:30:02]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3736kb
  • [2024-11-13 23:30:01]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

template <class T> using v = vector<T>;
using ll = long long;
using dd = long double;
using int2 = pair<int, int>;
using ll2 = pair<ll, ll>;
using dd2 = pair<dd, dd>;

#define f first
#define s second
#define all(x) begin(x), end(x)
istream &__cin = cin;
#ifdef DEV_MODE
#include "debug.h"
__cinwrapper __cin_wrapper;
#define cin __cin_wrapper
#else
#define dbg(...)
#define dbg2d(...)
#endif

template <class T1, class T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <class T> istream &operator>>(istream &in, v<T> &v) {
  for (auto &x : v)
    in >> x;
  return in;
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

/*
 _______________________________________
( If you don't fail at least 90% of the )
( time, you're not aiming high enough.  )
(                                       )
( - Alan Kay                            )
 ---------------------------------------
        o   ^__^
         o  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
*/

const bool INTERACTIVE = false;
const bool MULTITEST = false;
/******************************************************************************/

#pragma region templates

#pragma endregion templates

void solve() {
  int h1, b1, h2, b2;
  cin >> h1 >> b1 >> h2 >> b2;

  int score = 3 * (h1 - h2) + b1 - b2;

  if (score > 0) {
    cout << "1 " << score;
  } else if (score < 0) {
    cout << "2 " << -score;
  } else {
    cout << "NO SCORE";
  }
}

int main() {
#ifdef DEV_MODE
  debug_start(INTERACTIVE, "a.txt");
#else
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
#endif
  int t;
  if (MULTITEST)
    cin >> t;
  else
    t = 1;
  while (t--)
    solve();

#ifdef DEV_MODE
  debug_exit(INTERACTIVE);
#endif
}
#ifdef DEV_MODE
#include "debug.cpp"
#endif

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3580kb

input:

2 1
0 4

output:

1 3

result:

ok single line: '1 3'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

1 1
0 4

output:

NO SCORE

result:

ok single line: 'NO SCORE'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

2 2
3 0

output:

2 1

result:

ok single line: '2 1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

0 0
0 0

output:

NO SCORE

result:

ok single line: 'NO SCORE'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

0 0
0 1

output:

2 1

result:

ok single line: '2 1'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

0 1
0 1

output:

NO SCORE

result:

ok single line: 'NO SCORE'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

1 0
1 0

output:

NO SCORE

result:

ok single line: 'NO SCORE'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

1 1
1 0

output:

1 1

result:

ok single line: '1 1'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

1 1
1 1

output:

NO SCORE

result:

ok single line: 'NO SCORE'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

4 0
0 0

output:

1 12

result:

ok single line: '1 12'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

4 0
0 4

output:

1 8

result:

ok single line: '1 8'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

3 0
0 3

output:

1 6

result:

ok single line: '1 6'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

0 4
4 0

output:

2 8

result:

ok single line: '2 8'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

3 1
1 3

output:

1 4

result:

ok single line: '1 4'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

0 4
2 1

output:

2 3

result:

ok single line: '2 3'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

2 2
2 0

output:

1 2

result:

ok single line: '1 2'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

2 0
2 2

output:

2 2

result:

ok single line: '2 2'

Test #18:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

4 0
3 1

output:

1 2

result:

ok single line: '1 2'

Test #19:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

2 0
1 2

output:

1 1

result:

ok single line: '1 1'

Test #20:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

1 2
2 0

output:

2 1

result:

ok single line: '2 1'

Test #21:

score: 0
Accepted
time: 0ms
memory: 3648kb

input:

2 2
3 1

output:

2 2

result:

ok single line: '2 2'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

3 0
2 2

output:

1 1

result:

ok single line: '1 1'