Submission #19021430


Source Code Expand

Copy
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cstdlib>
#include <utility>
#include <cmath>
#include <queue>
#include <stack>
#include <cstring>

using namespace std;

#define ll long long

#ifndef ONLINE_JUDGE
#define debug(format, ...) fprintf(stderr, \
    "%s:%d: " format "\n", __func__, __LINE__,##__VA_ARGS__)
#else
#define debug(format, ...)
#define NDEBUG
#endif

bool a[4][100005];

int main()
{
    vector<pair<int, int> > ans;
    ans.push_back(make_pair(0, 0));
    int width = 0;
    double ratio = 1.0;
    while (ratio < 10) {
        int old_len = (int)ans.size();
        for (int i = 0; i < old_len; i++) {
            pair<int, int> cur = ans[i];
            cur.first += width * 2 + 1;
            ans.push_back(cur);
            cur.second += width * 2 + 1;
            ans.push_back(cur);
        }
        ratio *= 1.5;
        width = width * 3 + 1;
    }
    printf("%d\n", (int)ans.size());
    for (int i = 0; i < ans.size(); i++) {
        int x = ans[i].first;
        int y = ans[i].second;
        printf("%d %d\n", x, y);
    }
    return 0;
}

Submission Info

Submission Time
Task B - Bowling
User SHZhang
Language C++ (GCC 9.2.1)
Score 800
Code Size 1163 Byte
Status AC
Exec Time 3 ms
Memory 3108 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:45:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<std::pair<int, int> >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   45 |     for (int i = 0; i < ans.size(); i++) {
      |                     ~~^~~~~~~~~~~~

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 3 ms 3108 KB