제출 #290658

#제출 시각아이디문제언어결과실행 시간메모리
290658maximath_1Broken Device (JOI17_broken_device)C++11
컴파일 에러
0 ms0 KiB
#include "anna.h" #include <string.h> using namespace std; int broken[155], ret[155], bit[65]; void Anna(int N, long long X, int K, int P[]){ for(int i = 0; i <= 60; i ++) if((X >> i) & 1ll) bit[i] = 1; else bit[i] = 0; memset(broken, 0, sizeof(broken)); memset(ret, 0, sizeof(ret)); for(int i = 0; i < K; i ++) broken[P[i]] = 1; int it = 0; for(int i = 0; i < N && it < 60; i += 3){ int cnt = broken[i] + broken[i + 1] + broken[i + 2]; if(cnt == 0){ if(bit[it + 1] == 0){ if(bit[it] == 0){ ret[i] = 1; ret[i + 1] = ret[i + 2] = 0; }else{ ret[i] = 0; ret[i + 1] = ret[i + 2] = 1; } }else{ if(bit[it] == 0){ ret[i] = ret[i + 1] = 1; ret[i + 2] = 0; }else{ ret[i] = ret[i + 1] = ret[i + 2] = 1; } } it += 2; }else if(cnt == 1){ if(broken[i]){ if(bit[it] == 0){ ret[i] = ret[i + 1] = 0; ret[i + 2] = 1; }else{ ret[i] = ret[i + 2] = 0; ret[i + 1] = 1; } it ++; }else if(broken[i + 1]){ if(bit[it] == 0){ ret[i] = ret[i + 1] = 0; ret[i + 2] = 1; }else{ ret[i] = ret[i + 2] = 1; ret[i + 1] = 0; } it ++; }else{ if(bit[it] == 1){ ret[i] = ret[i + 2] = 0; ret[i + 1] = 1; it ++; }else{ if(bit[it + 1] == 0){ ret[i] = 1; ret[i + 1] = ret[i + 2] = 0; }else{ ret[i] = ret[i + 1] = 1; ret[i + 2] = 0; } it += 2; } } } } for(int i = 0; i < N; i ++) Set(i, ret[i]); }
#include "bruno.h" #include <iostream> using namespace std; int _bit[65]; long long Bruno(int N, int A[]){ int it = 0; for(int i = 0; i < N && it < 60; i += 3){ int gt = A[i] * 4 + A[i + 1] * 2 + A[i + 2]; if(gt == 0){ //nothing }else if(gt == 1){ _bit[it] = 0; it ++; }else if(gt == 2){ _bit[it] = 1; it ++; }else if(gt == 3){ _bit[it] = 1; _bit[it + 1] = 0; it += 2; }else if(gt == 4){ _bit[it] = _bit[it + 1] = 0; it += 2; }else if(gt == 5){ _bit[it] = 1; it ++; }else if(gt == 6){ _bit[it] = 0; _bit[it + 1] = 1; it += 2; }else if(gt == 7){ _bit[it] = _bit[it + 1] = 1; it += 2; } } long long ans = 0ll; for(int i = 0; i <= 60; i ++) if(_bit[i]) ans += (1ll << i); return ans; }

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

Anna.cpp:1:10: fatal error: anna.h: No such file or directory
    1 | #include "anna.h"
      |          ^~~~~~~~
compilation terminated.

Bruno.cpp:1:10: fatal error: bruno.h: No such file or directory
    1 | #include "bruno.h"
      |          ^~~~~~~~~
compilation terminated.