Submission #49364625


Source Code Expand

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector<vector<ll>> Mat;
#define fi first
#define se second
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);
void yes() { printf("yes\n"); }
void no() { printf("no\n"); }
void Yes() { printf("Yes\n"); }
void No() { printf("No\n"); }
void YES() { printf("YES\n"); }
void NO() { printf("NO\n"); }

int main() {
  int n;
  cin >> n;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; i + j <= n; j++) {
      for (int k = 0; i + j + k <= n; k++) {
        cout << i << " " << j << " " << k << endl;
      }
    }
  }

  return 0;
}

Submission Info

Submission Time
Task B - Tetrahedral Number
User yutas
Language C++ 20 (gcc 12.2)
Score 150
Code Size 863 Byte
Status AC
Exec Time 3 ms
Memory 3700 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 150 / 150
Status
AC × 2
AC × 22
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All 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, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
random_03.txt AC 1 ms 3560 KiB
random_04.txt AC 1 ms 3516 KiB
random_05.txt AC 1 ms 3516 KiB
random_06.txt AC 1 ms 3516 KiB
random_07.txt AC 1 ms 3448 KiB
random_08.txt AC 1 ms 3512 KiB
random_09.txt AC 1 ms 3476 KiB
random_10.txt AC 1 ms 3504 KiB
random_11.txt AC 1 ms 3516 KiB
random_12.txt AC 1 ms 3516 KiB
random_13.txt AC 2 ms 3572 KiB
random_14.txt AC 2 ms 3700 KiB
random_15.txt AC 2 ms 3512 KiB
random_16.txt AC 2 ms 3472 KiB
random_17.txt AC 2 ms 3540 KiB
random_18.txt AC 2 ms 3664 KiB
random_19.txt AC 2 ms 3564 KiB
random_20.txt AC 3 ms 3532 KiB
random_21.txt AC 3 ms 3664 KiB
random_22.txt AC 3 ms 3476 KiB
sample_01.txt AC 1 ms 3508 KiB
sample_02.txt AC 1 ms 3668 KiB