QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#263760#5419. TrianglesKhNURE_KIVICompile Error//C++236.5kb2023-11-25 06:35:502023-11-25 06:35:51

Judging History

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

  • [2023-11-25 06:35:51]
  • 评测
  • [2023-11-25 06:35:50]
  • 提交

answer

//#pragma GCC optimize("Ofast", "unroll-loops")
//#pragma GCC target("sse", "sse2", "sse3", "ssse3", "sse4")

#ifdef __APPLE__

#include <iostream>
#include <cmath>
#include <algorithm>
#include <stdio.h>
#include <cstdint>
#include <cstring>
#include <string>
#include <cstdlib>
#include <vector>
#include <bitset>
#include <map>
#include <queue>
#include <ctime>
#include <stack>
#include <set>
#include <list>
#include <random>
#include <deque>
#include <functional>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <complex>
#include <numeric>
#include <cassert>
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <thread>

#else
#include <bits/stdc++.h>
#endif

#define all(a) a.begin(),a.end()
#define len(a) (int)(a.size())
#define mp make_pair
#define pb push_back
#define fir first
#define sec second
#define fi first
#define se second

using namespace std;

typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;

template<typename T>
bool umin(T &a, T b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool umax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

#if __APPLE__
#define D for (bool _FLAG = true; _FLAG; _FLAG = false)
#define LOG(...) print(#__VA_ARGS__" ::", __VA_ARGS__) << endl

template<class ...Ts>
auto &print(Ts ...ts) { return ((cerr << ts << " "), ...); }

#else
#define D while (false)
#define LOG(...)
#endif

const int max_n = -1, inf = 1000111222;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

vector<array<int, 6> > a[11];

void solve() {
    int n;
    cin >> n;
    if(n == 24) {
        cout << "Yes\n"
                "0 0 500000000 0 400000000 300000000\n"
                "1000000000 0 500000000 0 600000000 300000000\n"
                "0 0 0 500000000 300000000 400000000\n"
                "0 1000000000 0 500000000 300000000 600000000\n"
                "0 1000000000 500000000 1000000000 400000000 700000000\n"
                "1000000000 1000000000 500000000 1000000000 600000000 700000000\n"
                "1000000000 1000000000 1000000000 500000000 700000000 600000000\n"
                "1000000000 0 1000000000 500000000 700000000 400000000\n"
                "0 0 400000000 300000000 300000000 400000000\n"
                "0 500000000 300000000 400000000 300000000 600000000\n"
                "0 1000000000 300000000 600000000 400000000 700000000\n"
                "500000000 1000000000 400000000 700000000 600000000 700000000\n"
                "1000000000 1000000000 600000000 700000000 700000000 600000000\n"
                "1000000000 500000000 700000000 600000000 700000000 400000000\n"
                "1000000000 0 700000000 400000000 600000000 300000000\n"
                "500000000 0 400000000 300000000 600000000 300000000\n"
                "500000000 500000000 400000000 300000000 300000000 400000000\n"
                "500000000 500000000 300000000 400000000 300000000 600000000\n"
                "500000000 500000000 300000000 600000000 400000000 700000000\n"
                "500000000 500000000 400000000 700000000 600000000 700000000\n"
                "500000000 500000000 600000000 700000000 700000000 600000000\n"
                "500000000 500000000 700000000 600000000 700000000 400000000\n"
                "500000000 500000000 700000000 400000000 600000000 300000000\n"
                "500000000 500000000 600000000 300000000 400000000 300000000";
        return;
    }
    if(n < 8) {
        cout << "No\n";
        return;
    }
    cout << "Yes\n";
    vector<array<int, 6> > ans;
    vector<array<int, 6> > can_split;
    int st_n = n;
    while(st_n - 3 >= 8) st_n -= 3;
    for(auto& x : a[st_n]) can_split.pb(x);
    while(len(ans) + len(can_split) < n) {
        auto cr = can_split.back(); can_split.pop_back();
        pair<int, int> A = {cr[0], cr[1]}, B = {cr[2], cr[3]}, C = {cr[4], cr[5]};
        if((A.fi + B.fi) % 2 || (A.se + B.se) % 2 || (C.fi + B.fi) % 2 || (C.se + B.se) % 2 || (A.fi + C.fi) % 2 || (A.se + C.se) % 2) {
            ans.push_back(cr);
            continue;
        }
        pair<int, int> AB = {(A.fi + B.fi) / 2, (A.se + B.se) / 2};
        pair<int, int> BC = {(B.fi + C.fi) / 2, (B.se + C.se) / 2};
        pair<int, int> CA = {(A.fi + C.fi) / 2, (A.se + C.se) / 2};
        can_split.pb({A.fi, A.se, AB.fi, AB.se, CA.fi, CA.se});
        can_split.pb({B.fi, B.se, AB.fi, AB.se, BC.fi, BC.se});
        can_split.pb({C.fi, C.se, CA.fi, CA.se, BC.fi, BC.se});
        can_split.pb({AB.fi, AB.se, BC.fi, BC.se, CA.fi, CA.se});
    }
    while(!can_split.empty()) {
        auto cr = can_split.back(); can_split.pop_back();
        for(auto& x : cr) cout << x << ' ';
        cout << '\n';
    }
    while(!can_split.empty()) {
        ans.pb(can_split.back());
        can_split.pop_back();
    }
    for(auto& x : ans) {
        for(auto& xx : x) cout << xx << ' ';
        cout << '\n';
    }
    cout << '\n';
}

signed main() {
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);

    a[8].pb({0, 0, 9, 75 0, 20});
    a[8].pb({0, 20, 9, 5, 10, 20});
    a[8].pb({10, 20, 9, 5, 11, 5});
    a[8].pb({11, 5, 20, 20, 10, 20});
    a[8].pb({11, 5, 20, 0, 20, 20});
    a[8].pb({10, 0, 20, 0, 11, 5});
    a[8].pb({10, 0, 9, 5, 11, 5});
    a[8].pb({0, 0, 10, 0, 9, 5});

    a[9].pb({0, 0, 14, 13, 0, 20});
    a[9].pb({0, 20, 12, 14, 11, 20});
    a[9].pb({11, 20, 12, 14, 14, 15});
    a[9].pb({12, 14, 14, 13, 14, 15});
    a[9].pb({14, 15, 11, 20, 20, 20});
    a[9].pb({14, 15, 20, 20, 20, 14});
    a[9].pb({14, 13, 14, 15, 20, 14});
    a[9].pb({14, 13, 20, 0, 20, 14});
    a[9].pb({0, 0, 20, 0, 14, 13});

    a[10].pb({0, 0, 10, 5, 0, 20});
    a[10].pb({0, 20, 10, 5, 20, 20});
    a[10].pb({20, 0, 10, 5, 20, 20});
    a[10].pb({0, 0, 8, 4, 9, 0});
    a[10].pb({9, 0, 8, 4, 10, 3});
    a[10].pb({10, 3, 10, 5, 8, 4});
    a[10].pb({10, 3, 10, 5, 12, 4});
    a[10].pb({11, 0, 10, 3, 12, 4});
    a[10].pb({9, 0, 11, 0, 10, 3});
    a[10].pb({11, 0, 12, 4, 20, 0});

    for(int i = 8; i <= 10; i++) {
        for(int j = 0; j < len(a[i]); j++)
            for(auto& x : a[i][j])
                x *= 1e9 / 20;
    }

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t = 1;

    //cin >> t;

    while (t--) solve();

}

/*
KIVI
*/

Details

answer.code: In function ‘int main()’:
answer.code:168:26: error: expected ‘}’ before numeric constant
  168 |     a[8].pb({0, 0, 9, 75 0, 20});
      |             ~            ^
answer.code:168:25: error: expected ‘)’ before numeric constant
  168 |     a[8].pb({0, 0, 9, 75 0, 20});
      |            ~            ^~
      |                         )
answer.code:168:31: error: expected ‘)’ before ‘}’ token
  168 |     a[8].pb({0, 0, 9, 75 0, 20});
      |            ~                  ^
      |                               )
answer.code: At global scope:
answer.code:168:32: error: expected unqualified-id before ‘)’ token
  168 |     a[8].pb({0, 0, 9, 75 0, 20});
      |                                ^
answer.code:169:5: error: ‘a’ does not name a type
  169 |     a[8].pb({0, 20, 9, 5, 10, 20});
      |     ^
answer.code:169:34: error: expected unqualified-id before ‘)’ token
  169 |     a[8].pb({0, 20, 9, 5, 10, 20});
      |                                  ^
answer.code:170:5: error: ‘a’ does not name a type
  170 |     a[8].pb({10, 20, 9, 5, 11, 5});
      |     ^
answer.code:170:34: error: expected unqualified-id before ‘)’ token
  170 |     a[8].pb({10, 20, 9, 5, 11, 5});
      |                                  ^
answer.code:171:5: error: ‘a’ does not name a type
  171 |     a[8].pb({11, 5, 20, 20, 10, 20});
      |     ^
answer.code:171:36: error: expected unqualified-id before ‘)’ token
  171 |     a[8].pb({11, 5, 20, 20, 10, 20});
      |                                    ^
answer.code:172:5: error: ‘a’ does not name a type
  172 |     a[8].pb({11, 5, 20, 0, 20, 20});
      |     ^
answer.code:172:35: error: expected unqualified-id before ‘)’ token
  172 |     a[8].pb({11, 5, 20, 0, 20, 20});
      |                                   ^
answer.code:173:5: error: ‘a’ does not name a type
  173 |     a[8].pb({10, 0, 20, 0, 11, 5});
      |     ^
answer.code:173:34: error: expected unqualified-id before ‘)’ token
  173 |     a[8].pb({10, 0, 20, 0, 11, 5});
      |                                  ^
answer.code:174:5: error: ‘a’ does not name a type
  174 |     a[8].pb({10, 0, 9, 5, 11, 5});
      |     ^
answer.code:174:33: error: expected unqualified-id before ‘)’ token
  174 |     a[8].pb({10, 0, 9, 5, 11, 5});
      |                                 ^
answer.code:175:5: error: ‘a’ does not name a type
  175 |     a[8].pb({0, 0, 10, 0, 9, 5});
      |     ^
answer.code:175:32: error: expected unqualified-id before ‘)’ token
  175 |     a[8].pb({0, 0, 10, 0, 9, 5});
      |                                ^
answer.code:177:5: error: ‘a’ does not name a type
  177 |     a[9].pb({0, 0, 14, 13, 0, 20});
      |     ^
answer.code:177:34: error: expected unqualified-id before ‘)’ token
  177 |     a[9].pb({0, 0, 14, 13, 0, 20});
      |                                  ^
answer.code:178:5: error: ‘a’ does not name a type
  178 |     a[9].pb({0, 20, 12, 14, 11, 20});
      |     ^
answer.code:178:36: error: expected unqualified-id before ‘)’ token
  178 |     a[9].pb({0, 20, 12, 14, 11, 20});
      |                                    ^
answer.code:179:5: error: ‘a’ does not name a type
  179 |     a[9].pb({11, 20, 12, 14, 14, 15});
      |     ^
answer.code:179:37: error: expected unqualified-id before ‘)’ token
  179 |     a[9].pb({11, 20, 12, 14, 14, 15});
      |                                     ^
answer.code:180:5: error: ‘a’ does not name a type
  180 |     a[9].pb({12, 14, 14, 13, 14, 15});
      |     ^
answer.code:180:37: error: expected unqualified-id before ‘)’ token
  180 |     a[9].pb({12, 14, 14, 13, 14, 15});
      |                                     ^
answer.code:181:5: error: ‘a’ does not name a type
  181 |     a[9].pb({14, 15, 11, 20, 20, 20});
      |     ^
answer.code:181:37: error: expected unqualified-id before ‘)’ token
  181 |     a[9].pb({14, 15, 11, 20, 20, 20});
      |                                     ^
answer.code:182:5: error: ‘a’ does not name a type
  182 |     a[9].pb({14, 15, 20, 20, 20, 14});
      |     ^
answer.code:182:37: error: expected unqualified-id before ‘)’ token
  182 |     a[9].pb({14, 15, 20, 20, 20, 14});
      |                                     ^
answer.code:183:5: error: ‘a’ does not name a type
  183 |     a[9].pb({14, 13, 14, 15, 20, 14});
      |     ^
answer.code:183:37: error: expected unqualified-id before ‘)’ token
  183 |     a[9].pb({14, 13, 14, 15, 20, 14});
      |                                     ^
answer.code:184:5: error: ‘a’ does not name a type
  184 |     a[9].pb({14, 13, 20, 0, 20, 14});
      |     ^
answer.code:184:36: error: expected unqualified-id before ‘)’ token
  184 |     a[9].pb({14, 13, 20, 0, 20, 14});
      |                                    ^
answer.code:185:5: error: ‘a’ does not name a type
  185 |     a[9].pb({0, 0, 20, 0, 14, 13});
      |     ^
answer.code:185:34: error: expected unqualified-id before ‘)’ token
  185 |     a[9].pb({0, 0, 20, 0, 14, 13});
      |                                  ^
answ...