제출 #1339916

#제출 시각아이디문제언어결과실행 시간메모리
1339916michael12Cup of Jamshid (IOI17_cup)C++20
컴파일 에러
0 ms0 KiB
#include "cup.h"
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<stack>
#include<queue>
#include<string.h>
#include<array>
#include<algorithm>
#include<cmath>
using namespace std;
const int maxn = 5e5;
int maxq = 29;
vector<int> find_cup(){
    int r1 = -5e8, r2 = -5e8;
    int cur = 0, cur1 = 0;
    int f = ask_shahrasb(r1, r2);
    for(int i = 0; i <= maxq - 1; i++){
        if(f & (1 << i)){
           int f2 = ask_shahrasb(r1  + (1 << i), r2);
           bool is = false, is1 = false;
           if(f & (1 << (i + 1))) is = true;
           if(f2 & (1 << (i + 1))) is2 = true;
           if(is == is1){
              cur += (1 << i);
           }
           else{
              cur1 += (1 << i);
           }
        }
        else{
           int f2 = ask_shahrasb(r1 + (1 << i), r2);
           bool is = false, is1 = false;
           if(f & (1 << (i + 1))) is = true;
           if(f2 & (1 << (i + 1))) is2 = true;
           if(is == is1){
              cur += (1 << i);
              cur1 += (1 << i);
           }
        }
    }

    vector<int> g = {cur, cur1};
    return g;
}
// signed main() {
//     ios::sync_with_stdio(false);
//     cin.tie(nullptr);
//     string s;
    


    
// }

컴파일 시 표준 에러 (stderr) 메시지

cup.cpp: In function 'std::vector<int> find_cup()':
cup.cpp:25:36: error: 'is2' was not declared in this scope; did you mean 'is1'?
   25 |            if(f2 & (1 << (i + 1))) is2 = true;
      |                                    ^~~
      |                                    is1
cup.cpp:37:36: error: 'is2' was not declared in this scope; did you mean 'is1'?
   37 |            if(f2 & (1 << (i + 1))) is2 = true;
      |                                    ^~~
      |                                    is1