結果
| 問題 | No.690 E869120 and Constructing Array 4 |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-07-22 16:14:57 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| + 356µs | |
| コード長 | 1,861 bytes |
| 記録 | |
| コンパイル時間 | 371 ms |
| コンパイル使用メモリ | 78,620 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-22 16:14:59 |
| 合計ジャッジ時間 | 1,833 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
/*
_/ _/ _/_/_/_/_/_/ _/ _/ _/_/
_/ _/ _/ _/_/ _/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/
_/_/_/_/_/_/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/_/ _/_/_/_/_/_/
_/ _/ _/ _/ _/ _/ _/
_/ _/ _/_/_/_/_/_/ _/ _/ _/ _/
*/
#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,32} ;
}
ans += 2 ;
write(32,' ') ;
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 ;
}
vjudge1