제출 #569057

#제출 시각아이디문제언어결과실행 시간메모리
569057losmi247Unscrambling a Messy Bug (IOI16_messy)C++14
20 / 100
1 ms212 KiB
#include <bits/stdc++.h> #include "messy.h" using namespace std; typedef long long ll; int n,w,r; vector <int> prvi(){ add_element("11110000"); add_element("11000000"); add_element("00000011"); add_element("10000000"); add_element("00100000"); add_element("00001000"); add_element("00000010"); compile_set(); vector <int> ret(8,0); for(int i = 0; i < 8; i++) ret[i] = i; string s = "11110000"; for(int i = 0; i < 4; i++){ for(int j = 4; j < 8; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } s = "11000000"; for(int i = 0; i < 2; i++){ for(int j = 2; j < 4; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } s = "00000011"; for(int i = 4; i < 6; i++){ for(int j = 6; j < 8; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } //cout << "najmanji" << endl; s = "10000000"; for(int i = 0; i < 1; i++){ for(int j = 1; j < 2; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } s = "00100000"; for(int i = 2; i < 3; i++){ for(int j = 3; j < 4; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } s = "00001000"; for(int i = 4; i < 5; i++){ for(int j = 5; j < 6; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } s = "00000010"; for(int i = 6; i < 7; i++){ for(int j = 7; j < 8; j++){ string h = s; swap(h[i],h[j]); if(check_element(h)){ swap(ret[i],ret[j]); return ret; } } } return ret; } vector <int> restore_permutation(int N,int W,int R){ n = N; w = W; r = R; if(n == 8 && w == 256 && r == 256){ return prvi(); } }

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

messy.cpp: In function 'std::vector<int> restore_permutation(int, int, int)':
messy.cpp:119:1: warning: control reaches end of non-void function [-Wreturn-type]
  119 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...