Submission #29471113


Source Code Expand

Copy
#include <bits/stdc++.h>
#define SZ(container) container.size()
#define REP(i, n) for (auto i = 0; i < n; ++i)
#define PER(i, n) for (auto i = n-1; i >= 0; --i)
#define RANGE(i, a, b) for (auto i = a; i <= b; ++i)
#define FOR(e, container) for (auto e : container)
#define ITE(e, container) for (auto e = nums.begin(); e != nums.end(); ++e)
#define ALL(container) container.begin(), container.end()
#define MP(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
void SetIO()
{
ios::sync_with_stdio(false);
cin.tie(0);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>

#define SZ(container) container.size()
#define REP(i, n) for (auto i = 0; i < n; ++i)
#define PER(i, n) for (auto i = n-1; i >= 0; --i)
#define RANGE(i, a, b) for (auto i = a; i <= b; ++i)
#define FOR(e, container) for (auto e : container)
#define ITE(e, container) for (auto e = nums.begin(); e != nums.end(); ++e)
#define ALL(container) container.begin(), container.end()
#define MP(a, b) make_pair(a, b)

using namespace std;

typedef long long ll;

typedef vector<int> vi;

void SetIO()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
}

const int NMAX=101;
vi lp(NMAX+1);
vi pr;
int prime[NMAX+1];

void FillPrimes() {
  for (int i=2; i <= NMAX; ++i) {
    if (lp[i] == 0) {
        lp[i] = i;
        pr.push_back(i);
    }
    for (int j=0; j < (int)pr.size() && pr[j] <= lp[i] && i*pr[j] <= NMAX; ++j) {
        lp[i * pr[j]] = pr[j];
    }
  }
  FOR(p, pr) {
    //cout << p << "\n";
    prime[p]=1;
  }
}

int main(int argc, char const *argv[])
{
  SetIO();
  FillPrimes();
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  bool canWin = true;
  RANGE(i, a, b) {
    canWin = true;
    RANGE(j, c, d) {
      if (prime[i+j]) {
        canWin = false;
        break;
      }
    }
    if (canWin) {
      break;
    }
  }
  if (canWin)
    cout << "Takahashi\n";
  else
    cout << "Aoki" << "\n";
}

Submission Info

Submission Time
Task D - Prime Sum Game
User janux
Language C++ (GCC 9.2.1)
Score 0
Code Size 1394 Byte
Status WA
Exec Time 3 ms
Memory 3644 KB

Compile Error

./Main.cpp: In function ‘int main(int, const char**)’:
./Main.cpp:45:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   45 | int main(int argc, char const *argv[])
      |          ~~~~^~~~
./Main.cpp:45:32: warning: unused parameter ‘argv’ [-Wunused-parameter]
   45 | int main(int argc, char const *argv[])
      |                    ~~~~~~~~~~~~^~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 29
WA × 4
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt WA 1 ms 3556 KB
hand_02.txt AC 2 ms 3600 KB
hand_03.txt AC 3 ms 3516 KB
random_01.txt AC 2 ms 3632 KB
random_02.txt AC 2 ms 3640 KB
random_03.txt AC 2 ms 3600 KB
random_04.txt AC 2 ms 3632 KB
random_05.txt AC 3 ms 3520 KB
random_06.txt AC 2 ms 3560 KB
random_07.txt AC 2 ms 3604 KB
random_08.txt AC 2 ms 3532 KB
random_09.txt AC 2 ms 3504 KB
random_10.txt AC 2 ms 3512 KB
random_11.txt AC 2 ms 3528 KB
random_12.txt AC 3 ms 3560 KB
random_13.txt AC 2 ms 3600 KB
random_14.txt WA 2 ms 3536 KB
random_15.txt AC 2 ms 3640 KB
random_16.txt AC 2 ms 3516 KB
random_17.txt AC 2 ms 3528 KB
random_18.txt AC 2 ms 3480 KB
random_19.txt WA 2 ms 3600 KB
random_20.txt WA 2 ms 3508 KB
random_21.txt AC 3 ms 3604 KB
random_22.txt AC 2 ms 3476 KB
random_23.txt AC 2 ms 3604 KB
random_24.txt AC 2 ms 3528 KB
random_25.txt AC 1 ms 3504 KB
random_26.txt AC 2 ms 3600 KB
random_27.txt AC 2 ms 3644 KB
sample_01.txt AC 2 ms 3596 KB
sample_02.txt AC 2 ms 3532 KB
sample_03.txt AC 2 ms 3576 KB


2025-03-04 (Tue)
11:48:57 +00:00