結果
| 問題 |
No.699 ペアでチームを作ろう2
|
| ユーザー |
|
| 提出日時 | 2018-06-26 01:50:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 472 bytes |
| コンパイル時間 | 532 ms |
| コンパイル使用メモリ | 66,472 KB |
| 実行使用メモリ | 13,756 KB |
| 最終ジャッジ日時 | 2024-06-30 22:47:15 |
| 合計ジャッジ時間 | 3,549 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 TLE * 1 -- * 9 |
コンパイルメッセージ
main.cpp:34:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
34 | main()
| ^~~~
ソースコード
#include<iostream>
#include<algorithm>
using namespace std;
int n,a[14];
bool used[14];
int ans;
void f(int i,int now)
{
if(i==n)
{
ans=max(ans,now);
}
else
{
for(int j=0;j<n;j++)
{
if(!used[j])
{
used[j]=1;
for(int k=j+1;k<n;k++)
{
if(!used[k])
{
used[k]=1;
f(i+2,now^(a[j]+a[k]));
used[k]=0;
}
}
used[j]=0;
}
}
}
}
main()
{
cin>>n;
for(int i=0;i<n;i++)cin>>a[i];
f(0,0);
cout<<ans<<endl;
}