QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#34558#162. Merges and Acquisitionsarvindr9Compile Error//C++1.6kb2022-06-10 22:28:472022-06-10 22:28:49

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-10 22:28:49]
  • 评测
  • [2022-06-10 22:28:47]
  • 提交

answer

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

using namespace std;

typedef int int2;
#define int long long
#define pi pair<int, int>
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define f first
#define s second
const int inf = 1e18;

int t;

const int maxn = 1e5 + 5;
vector<int> divs[maxn];
int dp[maxn];

#define EPS 1e-4

void gg() {
    cout << "NO\n";
    exit(0);
}

typedef double D;

D dis(D a, D b, D c, D d) {
    D dx = c - a;
    D dy = d - b;
    return sqrt(dx * dx + dy * dy);
}

bool check(string A, string B, string S) {
    // start with A first
    int n = S.size();
    int ia = 0;
    int ib = 0;
    bool possible = true;
    for (int i = 0; i < n; i++) {
        if (i % 2 == 0) {
            while (ia < (int)A.size() and A[ia] != S[i]) {
                ia++;
            }
            if (ia == (int)A.size()) possible = false;
            ia++;
        } else {
            while (ib < (int)B.size() and B[ib] != S[i]) {
                ib++;
            }
            if (ib == (int)B.size()) possible = false;
            ib++;
        }
    }
    return possible;
}

int2 main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    string S, T;
    cin >> S >> T;
    string target = S;
    if (check(S, T, target) or check(T, S, target)) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    

    
} 

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/

詳細信息

answer.code:1:2: error: stray ‘#’ in program
    1 | a#include <bits/stdc++.h>
      |  ^
answer.code:1:1: error: ‘a’ does not name a type
    1 | a#include <bits/stdc++.h>
      | ^
answer.code:18:1: error: ‘vector’ does not name a type
   18 | vector<int> divs[maxn];
      | ^~~~~~
answer.code: In function ‘void gg()’:
answer.code:24:5: error: ‘cout’ was not declared in this scope
   24 |     cout << "NO\n";
      |     ^~~~
answer.code:25:5: error: ‘exit’ was not declared in this scope
   25 |     exit(0);
      |     ^~~~
answer.code: In function ‘D dis(D, D, D, D)’:
answer.code:33:12: error: ‘sqrt’ was not declared in this scope
   33 |     return sqrt(dx * dx + dy * dy);
      |            ^~~~
answer.code: At global scope:
answer.code:36:12: error: ‘string’ was not declared in this scope
   36 | bool check(string A, string B, string S) {
      |            ^~~~~~
answer.code:36:22: error: ‘string’ was not declared in this scope
   36 | bool check(string A, string B, string S) {
      |                      ^~~~~~
answer.code:36:32: error: ‘string’ was not declared in this scope
   36 | bool check(string A, string B, string S) {
      |                                ^~~~~~
answer.code:36:40: error: expression list treated as compound expression in initializer [-fpermissive]
   36 | bool check(string A, string B, string S) {
      |                                        ^
answer.code: In function ‘int2 main()’:
answer.code:61:5: error: ‘ios’ has not been declared
   61 |     ios::sync_with_stdio(0);
      |     ^~~
answer.code:62:5: error: ‘cin’ was not declared in this scope
   62 |     cin.tie(0);
      |     ^~~
answer.code:63:5: error: ‘string’ was not declared in this scope
   63 |     string S, T;
      |     ^~~~~~
answer.code:64:12: error: ‘S’ was not declared in this scope
   64 |     cin >> S >> T;
      |            ^
answer.code:64:17: error: ‘T’ was not declared in this scope
   64 |     cin >> S >> T;
      |                 ^
answer.code:65:11: error: expected ‘;’ before ‘target’
   65 |     string target = S;
      |           ^~~~~~~
      |           ;
answer.code:66:21: error: ‘target’ was not declared in this scope
   66 |     if (check(S, T, target) or check(T, S, target)) {
      |                     ^~~~~~
answer.code:66:27: error: ‘check’ cannot be used as a function
   66 |     if (check(S, T, target) or check(T, S, target)) {
      |                           ^
answer.code:66:37: error: ‘check’ cannot be used as a function
   66 |     if (check(S, T, target) or check(T, S, target)) {
      |                                ~~~~~^~~~~~~~~~~~~~
answer.code:67:9: error: ‘cout’ was not declared in this scope
   67 |         cout << "Yes\n";
      |         ^~~~
answer.code:69:9: error: ‘cout’ was not declared in this scope
   69 |         cout << "No\n";
      |         ^~~~