답안 #1072892

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1072892 2024-08-24T06:35:14 Z Cyanberry Minerals (JOI19_minerals) C++14
0 / 100
2 ms 356 KB
#include <bits/stdc++.h>
using namespace std;
#include "minerals.h"
void Solve(int types) {
    bool side[types * 2];
    int sT[types], sF[types], match[types * 2];
    for (int i=0; i<types * 2; ++i) {
        side[i] = false;
        match[i] = 0;
    }
    int last = 0, sTc = 0, sFc = 0;
    for (int i=0; i<types * 2; ++i) {
        // if (i + 1 > types * 2 || i < 0) {
        //     Answer(0, 2);
        // }
        int curr = Query(i+1);
        if (curr > last) {
            ++last;
            sT[sTc] = i+1;
            ++sTc;
            side[i] = true;
        } else {
            sF[sFc] = i+1;
            ++sFc;
        }
    }
    bool inside[types];
    for (int i = 0; i < types; ++i) {
        inside[i] = true;
    }
    for (int i = 0; i < types; ++i) {
         if (sT[i] > 2 * types || sT[i] <= 0) cout<<"scream at me";
    }
    for (int i = log2(types); i >= 0; --i) {
        for (int j = 1; j <= types; ++j) {
            if (((j & (1<<i)) > 0) == inside[j]) {
                last = Query(sT[j]);
                inside[j] = !inside[j];
            }
        }
        for (int j =0; j < types; ++j) {
            // if (sF[j] > types * 2 || sF[j] < 1) {
            //     Answer(sF[0], sF[1]);
            // }
            int curr = Query(sF[j]);
            if (curr != last) {
                match[sF[j]-1] |= (1<<i);
                last = curr;
            }
        }
    }
    for (int i = 0; i < types * 2; ++i) {
        if (!side[i]) {
            cerr<<match[i]<<' ';
            Answer(i+1, sT[match[i]]);
        }
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Incorrect 1 ms 344 KB Wrong Answer [1]
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 356 KB Output is correct
3 Incorrect 0 ms 344 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -