結果

問題 No.934 Explosive energy drink
コンテスト
ユーザー nii
提出日時 2019-11-29 22:06:36
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,464 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 794 ms
コンパイル使用メモリ 101,872 KB
最終ジャッジ日時 2026-03-31 08:06:00
合計ジャッジ時間 1,158 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp:20:8: error: 'uint32_t' does not name a type
   20 | inline uint32_t Xor128(){
      |        ^~~~~~~~
main.cpp:15:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   14 | #include <fstream>
  +++ |+#include <cstdint>
   15 | using namespace std;
main.cpp: In member function 'int64_t Timer::getcycle()':
main.cpp:36:17: error: 'uint32_t' was not declared in this scope
   36 |                 uint32_t low,high;
      |                 ^~~~~~~~
main.cpp:36:17: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
main.cpp:37:48: error: 'low' was not declared in this scope; did you mean 'pow'?
   37 |                 __asm__ volatile ("rdtsc":"=a"(low),"=d"(high));
      |                                                ^~~
      |                                                pow
main.cpp:37:58: error: 'high' was not declared in this scope
   37 |                 __asm__ volatile ("rdtsc":"=a"(low),"=d"(high));
      |                                                          ^~~~

ソースコード

diff #
raw source code

#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <string>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <fstream>
using namespace std;
const long long inf=1e9+7;
const long long mod=1e9+7;
const int64_t CYCLES_PER_SEC=2800000000;
//
inline uint32_t Xor128(){
	static uint32_t x=123456789;
	static uint32_t y=362436069;
	static uint32_t z=521288629;
	static uint32_t w=88675123;
	uint32_t t=x^(x<<11);
	x=y;y=z;z=w;
	return w=(w^(w>>19))^(t^(t>>8));
}
struct Timer{
	int64_t start;
	Timer(){reset();}
	void reset(){start=getcycle();}
	void plus(double a){start-=(a*CYCLES_PER_SEC);}
	inline double get(){return (double)(getcycle()-start)/CYCLES_PER_SEC;}
	inline int64_t getcycle(){
		uint32_t low,high;
		__asm__ volatile ("rdtsc":"=a"(low),"=d"(high));
		return ((int64_t)low)|((int64_t)high<<32);
	}
};
//
int main(){
	int n;
	cin>>n;
	vector<int> ans;
	for(int i=0;i<n;i++){
		cout<<"? "<<n-1<<endl;
		vector<int> pri;
		for(int j=0;j<n;j++){
			if(i!=j){
				pri.push_back(j);
			}
		}
		for(int j=0;j<n-1;j++){
			cout<<pri[j]+1;
			if(j!=n-2){
				cout<<" ";
			}else{
				cout<<endl;
			}
		}
		int aa;
		cin>>aa;
		if(!aa){
			ans.push_back(i);
		}
	}
	cout<<"! ";
	cout<<ans.size()<<endl;
	for(int i=0;i<ans.size();i++){
		cout<<ans[i]+1;
		if(i!=ans.size()-1){
			cout<<" ";
		}else{
			cout<<endl;
		}
	}
	return 0;
}
0