QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#590029#6418. Ah, It's Yesterday Once Moreji_114514Compile Error//C++20930b2024-09-25 21:07:402024-09-25 21:07:40

Judging History

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

  • [2024-09-25 21:07:40]
  • 评测
  • [2024-09-25 21:07:40]
  • 提交

answer

f#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int N = 2e3 + 10, mod = 1e9 + 7;

int c[30][30], n = 20, m = 20;
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};

void solve()
{
    int st = 0, x = 1, y = 0, cnt = 0;
    while (cnt < 10)
    {
        x = x + dx[st], y = y + dy[st];

        if (x > n || y > m || x == 0 || y == 0 || c[x + dx[st]][y + dy[st]] || c[x][y]) {
            x -= dx[st], y -= dy[st];
            //cout << x << ' ' << y << endl;
            st = (st + 1) % 4, cnt++;
            continue;
        }
        c[x][y] = 1, cnt = 0;
    }
    c[x][y] = 0;
    cout << 20 << ' ' << 20 << endl;
    for (int i = 1; i <= 20; i++)
    {
        for (int j = 1; j <= 20; j++)cout << c[i][j];
        cout << endl;
    }
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    while (t--)solve();
    return 0;
}

詳細信息

answer.code:1:2: error: stray ‘#’ in program
    1 | f#include<bits/stdc++.h>
      |  ^
answer.code:1:1: error: ‘f’ does not name a type
    1 | f#include<bits/stdc++.h>
      | ^
answer.code: In function ‘void solve()’:
answer.code:27:5: error: ‘cout’ was not declared in this scope
   27 |     cout << 20 << ' ' << 20 << endl;
      |     ^~~~
answer.code:27:32: error: ‘endl’ was not declared in this scope
   27 |     cout << 20 << ' ' << 20 << endl;
      |                                ^~~~
answer.code: In function ‘int main()’:
answer.code:37:5: error: ‘ios’ has not been declared
   37 |     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |     ^~~
answer.code:37:30: error: ‘cin’ was not declared in this scope
   37 |     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |                              ^~~
answer.code:37:42: error: ‘cout’ was not declared in this scope
   37 |     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
      |                                          ^~~~