結果
| 問題 | 
                            No.282 おもりと天秤(2)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2015-09-19 02:08:33 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,731 bytes | 
| コンパイル時間 | 4,429 ms | 
| コンパイル使用メモリ | 81,412 KB | 
| 実行使用メモリ | 85,640 KB | 
| 平均クエリ数 | 115.33 | 
| 最終ジャッジ日時 | 2024-07-16 06:15:11 | 
| 合計ジャッジ時間 | 22,460 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 2 WA * 11 RE * 11 | 
ソースコード
package contest;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
public class Q721 {
	static Scanner in;
	static PrintWriter out;
	static String INPUT = "";
	
	static void solve()
	{
		int n = ni();
		in.nextLine();
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = i+1;
		for(int i = 0;i < n-1;i++){
			if(i % 2 == 0){
				out.print("?");
				for(int j = 0;j < n/2*2;j++){
					out.print(" " + a[j]);
				}
				for(int j = n/2*2;j < 2*n;j++){
					out.print(" " + 0);
				}
				out.println();
				out.flush();
				
				char[] s = in.nextLine().trim().toCharArray();
				for(int j = 0;j < n/2;j++){
					if(s[2*j] == '>'){
						int d = a[2*j]; a[2*j] = a[2*j+1]; a[2*j+1] = d;
					}
				}
			}else{
				out.print("?");
				for(int j = 1;j < 1+(n-1)/2*2;j++){
					out.print(" " + a[j+1]);
				}
				for(int j = (n-1)/2*2;j < 2*n;j++){
					out.print(" " + 0);
				}
				out.println();
				out.flush();
				
				char[] s = in.nextLine().trim().toCharArray();
				for(int j = 0;j < (n-1)/2;j++){
					if(s[2*j] == '>'){
						int d = a[2*j+1]; a[2*j+1] = a[2*j+2]; a[2*j+2] = d;
					}
				}
			}
		}
		out.print("!");
		for(int j = 0;j < n;j++){
			out.print(" " + a[j]);
		}
		out.println();
		out.flush();
	}
	
	public static void main(String[] args) throws Exception
	{
		in = INPUT.isEmpty() ? new Scanner(System.in) : new Scanner(INPUT);
		out = new PrintWriter(System.out);
		
		solve();
		out.flush();
	}
	
	static int ni() { return Integer.parseInt(in.next()); }
	static long nl() { return Long.parseLong(in.next()); }
	static double nd() { return Double.parseDouble(in.next()); }
	static void tr(Object... o) { if(INPUT.length() != 0)System.out.println(Arrays.deepToString(o)); }
}