結果

問題 No.690 E869120 and Constructing Array 4
コンテスト
ユーザー vjudge1
提出日時 2026-07-22 16:12:54
言語 C++14
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,861 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,498 ms
コンパイル使用メモリ 78,200 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-22 16:13:01
合計ジャッジ時間 5,988 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/*
_/        _/   _/_/_/_/_/_/   _/        _/         _/_/
_/        _/        _/        _/_/      _/       _/   _/
_/        _/        _/        _/  _/    _/      _/     _/
_/_/_/_/_/_/        _/        _/    _/  _/     _/       _/
_/        _/        _/        _/      _/_/     _/_/_/_/_/_/
_/        _/        _/        _/        _/    _/          _/
_/        _/   _/_/_/_/_/_/   _/        _/   _/            _/
*/
#include<iostream>
#include<cstdio>
#define re register
#define endl '\n'
#define ll long long
#define ull unsigned long long
#define db double
#define fi const int&
#define fl const ll&
#define ful const ull&
#define fc const char&
#define fs const string&
#define debug() puts("Running Successfully")
using namespace std ;
namespace IO {
	template<class T>inline void read(T &x){char c=getchar(),f=false;x=0;while(c<48||c>57) {f|=(c==45),c=getchar();}while(c>=48&&c<=57){x=(x<<3)+(x<<1)+(c^48),c=getchar();}if(f){x=~x+1;}}
	template<class T,class ...Arg>inline void read(T &x,Arg &...arg){read(x),read(arg...);}
	template<class T>inline void write(T x){if(x<0){putchar(45),x=~x+1;}if(x>9){write(x/10);}putchar(x%10|48);}
	template<class T>inline void write(T x,fc c){write(x),putchar(c);}
}using namespace IO ;
int x ;
struct edge {
	int u,v ;
}e[4002] ;
int tot ;
inline void solve () {
	int tmp = x,bit = 0,ans = 0,len = 0 ;
	bool d[65] ;
	while (tmp) {
		d[len++] = tmp & 1 ;
		if (tmp & 1) ans = bit ;
		tmp >>= 1,++bit ;
	}
	for (re int i = 0 ; i < len ; ++i) {
		if (d[i]) e[++tot] = {i + 2,62} ;
	}
	ans += 2 ;
	write(62,' ') ;
	write(ans * (ans - 1) / 2 + tot,endl) ;
	for (re int i = 1 ; i < ans ; ++i) {
		for (re int j = i + 1 ; j <= ans ; ++j) {
			write(i,' ') ;
			write(j,endl) ;
		}
	}
	for (re int i = 1 ; i <= tot ; ++i) {
		write(e[i].u,' ') ;
		write(e[i].v,endl) ;
	}
}
int main () {
	read(x) ;
	solve() ;
	return 0 ;
}
0