QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#217256#7120. Soccerhocky#0 1394ms4212kbC++141.5kb2023-10-16 17:48:482024-04-28 07:53:00

Judging History

你现在查看的是最新测评结果

  • [2024-04-28 07:53:00]
  • 管理员手动重测本题所有提交记录
  • 测评结果:0
  • 用时:1394ms
  • 内存:4212kb
  • [2023-10-16 17:48:48]
  • 评测
  • 测评结果:0
  • 用时:1215ms
  • 内存:3868kb
  • [2023-10-16 17:48:48]
  • 提交

answer

#include "soccer.h"

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL, LL> PLL;
typedef vector <int> vi;
typedef vector <vi> vvi;
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i = a;i < b;i++)
#define trav(nx, v) for(auto &nx : v)
#define all(a) begin(a), end(a)
#define sz(v) (int) v.size()

int n;
bool check(const vvi &stadium){
	// cek kolom
	rep(iter,0,2){
		for(int i = 0;i < n;i++){
			// cek min sama max 2 setiap baris
			int meet = 0;
			for(int j = 0;j < n;j++){
				int x = i;
				int y = j;
				if(!iter) swap(x, y);
				if(!meet){
					if(stadium[x][y] == 2) meet++;
					else continue;
				} else if(meet == 1){
					if(stadium[x][y] == 2) continue;
					else meet++;
				} else{
					if(stadium[x][y] == 2) return 0;
					else continue;
				}
			}
		}
	}
	return 1;
}

int biggest_stadium(int N, std::vector<std::vector<int>> F){
	vvi tmp = F;
	n = N;
	int ans = 0;
	rep(mask,0,(1<<(N * N))){
		rep(i,0,N) rep(j,0,N) if(tmp[i][j] == 2) tmp[i][j] = 0;
		bool can = 1;
		rep(i,0,N * N) if((mask>>i)&1 && tmp[i/N][i%N] == 1) can = 0;
		if(!can) continue;
		rep(i,0,N * N) if((mask>>i)&1 && tmp[i/N][i%N] == 0){
			tmp[i/N][i%N] = 2;
		}
		can = check(tmp);
		if(!can) continue;
		auto curans = __builtin_popcount(mask);
		if(curans > ans){
			ans = curans;
			//~ rep(i,0,N) {
				//~ rep(j,0,N) cout << tmp[i][j];
				//~ cout << endl;
			//~ }
		
		}
	}
    return ans	;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Time Limit Exceeded

Test #1:

score: 6
Accepted
time: 0ms
memory: 3808kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 6
Accepted
time: 0ms
memory: 4108kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

ok ok

Test #3:

score: 1.5
Acceptable Answer
time: 1394ms
memory: 4212kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
0

result:

points 0.250 partial

Test #4:

score: 0
Time Limit Exceeded

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
500
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:


result:


Subtask #2:

score: 0
Wrong Answer

Test #10:

score: 8
Accepted
time: 1ms
memory: 3800kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

ok ok

Test #11:

score: 8
Accepted
time: 0ms
memory: 3812kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
5

result:

ok ok

Test #12:

score: 0
Wrong Answer
time: 0ms
memory: 4096kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 1 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
6

result:

wrong answer wrong

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

0%