답안 #945312

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
945312 2024-03-13T15:51:39 Z Nika533 Unscrambling a Messy Bug (IOI16_messy) C++14
38 / 100
1 ms 600 KB
#pragma GCC diagnostic warning "-std=c++11"
#include "messy.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
vector<int> restore_permutation(int n, int w, int r) {
//   add_element("0");
//   compile_set();
//   check_element("0");
	string s="";
	for (int i=0; i<n; i++) s.pb('0');
	for (int i=0; i<n; i++) {
		s[i]='1';
		add_element(s);
	}
	compile_set();
	vector<int> p(n,0);
	s="";
	for (int i=0; i<n; i++) s.pb('0'); 
	for (int i=0; i<n; i++) {
		string s2=s;
		for (int j=0; j<n; j++) {
			if (s2[j]=='0') {
				s2[j]='1';
				if (check_element(s2)) {
					p[j]=i;
					s[j]='1';
					break;
				}
				s2[j]='0';
			}
		}
	}
	return p;
}

Compilation message

messy.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
    1 | #pragma GCC diagnostic warning "-std=c++11"
      |                                ^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB n = 8
2 Correct 0 ms 348 KB n = 8
3 Correct 0 ms 348 KB n = 8
4 Correct 0 ms 348 KB n = 8
5 Correct 0 ms 348 KB n = 8
6 Correct 0 ms 348 KB n = 8
7 Correct 0 ms 348 KB n = 8
8 Correct 0 ms 348 KB n = 8
9 Correct 1 ms 344 KB n = 8
10 Correct 1 ms 348 KB n = 8
11 Correct 1 ms 348 KB n = 8
12 Correct 0 ms 436 KB n = 8
13 Correct 0 ms 600 KB n = 8
14 Correct 0 ms 348 KB n = 8
15 Correct 1 ms 348 KB n = 8
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB n = 32
2 Correct 1 ms 348 KB n = 32
3 Correct 1 ms 600 KB n = 32
4 Correct 1 ms 348 KB n = 32
5 Correct 0 ms 432 KB n = 32
6 Correct 0 ms 348 KB n = 32
7 Correct 0 ms 348 KB n = 32
8 Correct 1 ms 348 KB n = 32
9 Correct 0 ms 348 KB n = 32
10 Correct 0 ms 348 KB n = 32
11 Correct 1 ms 348 KB n = 32
12 Correct 1 ms 348 KB n = 32
13 Correct 0 ms 348 KB n = 32
14 Correct 0 ms 348 KB n = 32
15 Correct 0 ms 348 KB n = 32
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB n = 32
2 Correct 0 ms 436 KB n = 32
3 Incorrect 1 ms 600 KB grader returned WA
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB grader returned WA
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB grader returned WA
2 Halted 0 ms 0 KB -