QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90750#5255. Greedy DrawersValera_GrinenkoCompile Error//C++145.7kb2023-03-25 04:24:562023-03-25 04:25:00

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-25 04:25:00]
  • 评测
  • [2023-03-25 04:24:56]
  • 提交

answer


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

#ifdef __APPLE__

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#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 <immintrin.h>
#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

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

int x[6] = {2, 3, 4, 5, 6, 6};
int y[6] = {0, 0, 2, 3, 4, 4};

void solve() {
    int n; cin >> n;
    vector<pair<int, int> > a, b;
    for(int i = 1; i <= n; i++) a.pb({i, 700 - i + 1});
    int kek = 0;
    while(kek + 6 <= n) {
        for(int i = 0; i < 6; i++) b.pb({kek + x[i], 700 - (kek + y[i])});
        kek += 6;
    }
    for(int i = kek + 1; i <= n; i++) b.pb({n, 700 - kek});
    for(auto& X : a) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
    for(auto& X : b) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
//    for(int i = 1; i <= n; i++) cout << i << ' ' << 696 - i << '\n';
//    cout << '\n';
//    int kek = 0;
//    while(kek + 8 <= n) {
//        for(int i = 0; i < 8; i++) {
//            cout << 696 - (kek + x[i]) << ' ' << kek + y[i] << '\n';
//        }
//        kek += 8;
//    }
//    for (int i = kek + 1; i <= n; i++) {
//        cout << n << ' ' << 696 - (kek + 1) << '\n';
//    }
}

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

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

    int t = 1;

    //cin >> t;

    while (t--) solve();

}

/*
KIVI
*/

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

#ifdef __APPLE__

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#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 <immintrin.h>
#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

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

int x[6] = {2, 3, 4, 5, 6, 6};
int y[6] = {0, 0, 2, 3, 4, 4};

void solve() {
    int n; cin >> n;
    vector<pair<int, int> > a, b;
    for(int i = 1; i <= n; i++) a.pb({i, 700 - i + 1});
    int kek = 0;
    while(kek + 6 <= n) {
        for(int i = 0; i < 6; i++) b.pb({kek + x[i], 700 - (kek + y[i])});
        kek += 6;
    }
    for(int i = kek + 1; i <= n; i++) b.pb({n, 700 - kek});
    for(auto& X : a) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
    for(auto& X : b) cout << X.fi << ' ' << X.se << '\n';
    cout << '\n';
//    for(int i = 1; i <= n; i++) cout << i << ' ' << 696 - i << '\n';
//    cout << '\n';
//    int kek = 0;
//    while(kek + 8 <= n) {
//        for(int i = 0; i < 8; i++) {
//            cout << 696 - (kek + x[i]) << ' ' << kek + y[i] << '\n';
//        }
//        kek += 8;
//    }
//    for (int i = kek + 1; i <= n; i++) {
//        cout << n << ' ' << 696 - (kek + 1) << '\n';
//    }
}

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

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

    int t = 1;

    //cin >> t;

    while (t--) solve();

}

/*
KIVI
*/

Details

answer.code:198:6: error: redefinition of ‘template<class T> bool umin(T&, T)’
  198 | bool umin(T &a, T b) {
      |      ^~~~
answer.code:59:6: note: ‘template<class T> bool umin(T&, T)’ previously declared here
   59 | bool umin(T &a, T b) {
      |      ^~~~
answer.code:207:6: error: redefinition of ‘template<class T> bool umax(T&, T)’
  207 | bool umax(T &a, T b) {
      |      ^~~~
answer.code:68:6: note: ‘template<class T> bool umax(T&, T)’ previously declared here
   68 | bool umax(T &a, T b) {
      |      ^~~~
answer.code:227:9: error: redefinition of ‘std::mt19937 rng’
  227 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      |         ^~~
answer.code:88:9: note: ‘std::mt19937 rng’ previously declared here
   88 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      |         ^~~
answer.code:229:5: error: redefinition of ‘int x [6]’
  229 | int x[6] = {2, 3, 4, 5, 6, 6};
      |     ^
answer.code:90:5: note: ‘int x [6]’ previously defined here
   90 | int x[6] = {2, 3, 4, 5, 6, 6};
      |     ^
answer.code:230:5: error: redefinition of ‘int y [6]’
  230 | int y[6] = {0, 0, 2, 3, 4, 4};
      |     ^
answer.code:91:5: note: ‘int y [6]’ previously defined here
   91 | int y[6] = {0, 0, 2, 3, 4, 4};
      |     ^
answer.code:232:6: error: redefinition of ‘void solve()’
  232 | void solve() {
      |      ^~~~~
answer.code:93:6: note: ‘void solve()’ previously defined here
   93 | void solve() {
      |      ^~~~~
answer.code:260:8: error: redefinition of ‘int main()’
  260 | signed main() {
      |        ^~~~
answer.code:121:8: note: ‘int main()’ previously defined here
  121 | signed main() {
      |        ^~~~