結果
| 問題 | 
                            No.282 おもりと天秤(2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             どらら
                         | 
                    
| 提出日時 | 2015-09-18 23:46:26 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,530 bytes | 
| コンパイル時間 | 973 ms | 
| コンパイル使用メモリ | 90,384 KB | 
| 実行使用メモリ | 29,380 KB | 
| 平均クエリ数 | 109.75 | 
| 最終ジャッジ日時 | 2024-07-16 05:59:07 | 
| 合計ジャッジ時間 | 9,668 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 RE * 22 | 
ソースコード
#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(){
  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(tmp == "="){
        ;
      }else{
        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;
}
            
            
            
        
            
どらら