QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#789124#9629. 小 C 的神秘图形Hojstyer#Compile Error//C++201.2kb2024-11-27 19:20:382024-11-27 19:20:41

Judging History

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

  • [2024-11-27 19:20:41]
  • 评测
  • [2024-11-27 19:20:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

void solve()
{#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

void solve()
{
    int n;
    cin >> n;
    string a, b;
    cin >> a >> b;

    for (int i = 0; i < n - 1; ++i)
    {
        if (!(a[i] == '1' || b[i] == '1'))
        {
            cout << 0 << '\n';
            return;
        }
    }

    if (a[n - 1] == '1' || b[n - 1] == '1')
        cout << 1 << '\n';
    else
        cout << 0 << "\n";
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
    int n;
    cin >> n;
    string a, b;
    cin >> a >> b;

    for (int i = 0; i < n - 1; ++i)
    {
        if (a[i] == '2' || b[i] == '2')
        {
            cout << 0 << '\n';
            return;
        }
    }

    if (a[n - 1] == '1' || b[n - 1] == '1')
        cout << 1 << '\n';
    else
        cout << 0 << "\n";
}

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

詳細信息

answer.code:7:2: error: stray ‘#’ in program
    7 | {#include <bits/stdc++.h>
      |  ^
answer.code: In function ‘void solve()’:
answer.code:7:12: error: ‘bits’ was not declared in this scope
    7 | {#include <bits/stdc++.h>
      |            ^~~~
answer.code:7:17: error: ‘stdc’ was not declared in this scope; did you mean ‘std’?
    7 | {#include <bits/stdc++.h>
      |                 ^~~~
      |                 std
answer.code:7:3: error: ‘include’ was not declared in this scope
    7 | {#include <bits/stdc++.h>
      |   ^~~~~~~
answer.code:8:1: error: expected primary-expression before ‘using’
    8 | using namespace std;
      | ^~~~~
answer.code:13:1: error: a function-definition is not allowed here before ‘{’ token
   13 | {
      | ^
answer.code:34:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   34 | int main()
      |         ^~
answer.code:34:9: note: remove parentheses to default-initialize a variable
   34 | int main()
      |         ^~
      |         --
answer.code:34:9: note: or replace parentheses with braces to value-initialize a variable
answer.code:35:1: error: a function-definition is not allowed here before ‘{’ token
   35 | {
      | ^