Submission #19553619


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(40)

const ll MOD = 1000000007;
const ll INF = (ll) 1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<pll> ans;
    ans.push_back(pll(0, 0));
    ans.push_back(pll(1, 0));
    ans.push_back(pll(0, 1));
    ll cnt0 = 3, cnt1 = 2;
    ll left = 1, up = 1;
    while (cnt0 < 10LL * cnt1) {
        cnt0 *= 3LL;
        cnt1 *= 2LL;
        ll leftOfs = left + up + 1;
        ll upOfs = up + left + 1;
        vector<pll> add;
        for (ll i = ans.size() - 1; i >= 0; --i) {
            pll a(ans[i].first + leftOfs, ans[i].second);
            pll b(ans[i].first, ans[i].second + upOfs);
            ans.push_back(a);
            ans.push_back(b);
            left = std::max(left, a.first);
            up = std::max(up, b.second);
        }
    }
    cout << ans.size() << endl;
    REP(i, ans.size()) {
        cout << INF - ans[i].first << " " << ans[i].second << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task B - Bowling
User coco18000
Language C++ (GCC 9.2.1)
Score 800
Code Size 1180 Byte
Status AC
Exec Time 8 ms
Memory 3568 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:8:29: warning: unnecessary parentheses in declaration of ‘i’ [-Wparentheses]
    8 | #define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
      |                             ^
./Main.cpp:9:19: note: in expansion of macro ‘FOR’
    9 | #define REP(i, n) FOR(i,n,0)
      |                   ^~~
./Main.cpp:40:5: note: in expansion of macro ‘REP’
   40 |     REP(i, ans.size()) {
      |     ^~~
./Main.cpp:8:40: warning: comparison of integer expressions of different signedness: ‘ll’ {aka ‘long long int’} and ‘std::vector<std::pair<long long int, long long int> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    8 | #define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
      |                                     ~~~^~~~
./Main.cpp:9:19: note: in expansion of macro ‘FOR’
    9 | #define REP(i, n) FOR(i,n,0)
      |                   ^~~
./Main.cpp:40:5: note: in expansion of macro ‘REP’
   40 |     REP(i, ans.size()) {
      |     ^~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 800 / 800
Status
AC × 1
AC × 1
Set Name Test Cases
Sample example0.txt
All example0.txt
Case Name Status Exec Time Memory
example0.txt AC 8 ms 3568 KB