結果

問題 No.452 横着者のビンゴゲーム
ユーザー chaemonchaemon
提出日時 2016-12-03 00:18:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,957 bytes
コンパイル時間 975 ms
コンパイル使用メモリ 104,516 KB
実行使用メモリ 7,552 KB
最終ジャッジ日時 2024-05-05 16:54:48
合計ジャッジ時間 23,731 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 10 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 12 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2,483 ms
7,552 KB
testcase_15 AC 2,398 ms
7,296 KB
testcase_16 AC 1,448 ms
5,632 KB
testcase_17 AC 132 ms
5,376 KB
testcase_18 AC 369 ms
5,376 KB
testcase_19 AC 236 ms
5,376 KB
testcase_20 AC 172 ms
5,376 KB
testcase_21 AC 881 ms
5,376 KB
testcase_22 AC 121 ms
5,376 KB
testcase_23 AC 1,620 ms
5,376 KB
testcase_24 AC 105 ms
5,376 KB
testcase_25 AC 55 ms
5,376 KB
testcase_26 AC 1,035 ms
5,376 KB
testcase_27 AC 658 ms
5,376 KB
testcase_28 AC 467 ms
5,376 KB
testcase_29 AC 286 ms
5,376 KB
testcase_30 AC 1,287 ms
5,376 KB
testcase_31 AC 173 ms
5,376 KB
testcase_32 AC 107 ms
5,376 KB
testcase_33 AC 504 ms
5,376 KB
testcase_34 AC 423 ms
5,376 KB
testcase_35 AC 322 ms
5,376 KB
testcase_36 AC 70 ms
5,376 KB
testcase_37 AC 74 ms
5,376 KB
testcase_38 TLE -
testcase_39 AC 2,625 ms
5,760 KB
testcase_40 AC 2,600 ms
5,504 KB
testcase_41 AC 2,628 ms
5,632 KB
testcase_42 AC 2,628 ms
5,632 KB
testcase_43 AC 2,671 ms
5,632 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int calc(int, int)':
main.cpp:89:1: warning: no return statement in function returning non-void [-Wreturn-type]
   89 | }
      | ^

ソースコード

diff #

// #includes {{{
#include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <cstring>
#include <cmath>
using namespace std;
// }}}
// pre-written code {{{
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

const int INF=0x3f3f3f3f;

typedef long long Int;
typedef unsigned long long uInt;
#ifdef __MINGW32__
typedef double rn;
#else
typedef long double rn;
#endif

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

int C[222][111][111];
vector<vector<set<int> > > v;

int N,M;

vector<set<int> > make_blist(int s){
	vector<set<int> > bs;
	REP(i,N){
		set<int> st;
		REP(j,N)st.insert(C[s][i][j]);
		bs.push_back(st);
	}
	REP(j,N){
		set<int> st;
		REP(i,N)st.insert(C[s][i][j]);
		bs.push_back(st);
	}
	{
		set<int> st;
		REP(i,N)st.insert(C[s][i][i]);
		bs.push_back(st);
	}
	{
		set<int> st;
		REP(i,N)st.insert(C[s][i][N-1-i]);
		bs.push_back(st);
	}
	return bs;
}

int calc(int s,int t){


}

int main(){
	cin>>N>>M;
	REP(t,M)REP(i,N)REP(j,N)cin>>C[t][i][j];
	REP(t,M){
		v.push_back(make_blist(t));
	}
	int ans = INF;
	REP(t,M)RREP(s,t+1,M){
		for(auto a:v[t])for(auto b:v[s]){
			set<int> c = a;
			c.insert(ALL(b));
			ans = min((int)c.size(),ans);
		}
	}
	cout<<max(1,ans-1)<<endl;
	return 0;
}
0