結果
| 問題 |
No.282 おもりと天秤(2)
|
| コンテスト | |
| ユーザー |
どらら
|
| 提出日時 | 2015-09-18 23:49:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,540 bytes |
| コンパイル時間 | 966 ms |
| コンパイル使用メモリ | 90,148 KB |
| 実行使用メモリ | 29,432 KB |
| 平均クエリ数 | 109.79 |
| 最終ジャッジ日時 | 2024-07-16 06:00:11 |
| 合計ジャッジ時間 | 9,840 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 1 RE * 21 |
ソースコード
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
string memo[505][505];
struct ST {
int X;
};
bool operator<(const ST& a, const ST& b){
if(memo[a.X][b.X] == "<") return true;
if(memo[a.X][b.X] == ">") return false;
if(memo[b.X][a.X] == ">") return true;
if(memo[b.X][a.X] == "<") return false;
return true;
}
int main(){
ios::sync_with_stdio(false);
int N;
cin >> N;
vector< pair<int,int> > v;
rep(i,N){
REP(j,i+1,N){
v.push_back(make_pair(i+1,j+1));
}
}
int idx = 0;
while(idx < v.size()){
cout << "?";
int bgn = idx;
rep(i,N){
if(idx<v.size()){
cout << " " << v[idx].first << " " << v[idx].second;
idx++;
}else{
cout << " 0 0";
}
}
cout << endl;
string tmp;
rep(i,N){
cin >> tmp;
if(bgn<v.size()){
memo[v[bgn].first][v[bgn].second] = tmp;
bgn++;
}
}
}
vector<ST> w;
rep(i,N){
w.push_back((ST){i+1});
}
sort(ALLOF(w));
cout << "!";
rep(i,N){
cout << " " << w[i].X;
}
cout << endl;
return 0;
}
どらら