結果

問題 No.1880 Many Ways
ユーザー 沙耶花沙耶花
提出日時 2022-03-18 22:15:30
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,137 bytes
コンパイル時間 6,903 ms
コンパイル使用メモリ 257,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 10:05:39
合計ジャッジ時間 18,660 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 3 ms
6,944 KB
testcase_12 AC 3 ms
6,944 KB
testcase_13 AC 3 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define Inf 1000000001

long long get(vector<int> a,vector<int> b){
	vector<long long> dp(122,0);
	dp[0] = 1;
	vector<vector<int>> E(122);
	rep(i,a.size())E[a[i]].push_back(b[i]);
	rep(i,122){
		rep(j,E[i].size()){
			dp[E[i][j]] += dp[i];
		}
	}
	
	rep(i,dp.size()){
		cout<<dp[i]<<endl;
	}
	return dp.back();
}

int main(){
	
	long long aa;
	cin>>aa;
	
	vector<int> a,b;
	
	a.push_back(0);
	b.push_back(1);
	
	rep(i,39){
		int x = 1 + i;
		int y = 41 + i;
		rep(j,2){
			rep(k,2){
				int z = x;
				if(j==1)z = y;
				int w = 2 + i;
				if(k==1)w += 40;
				a.push_back(z);
				b.push_back(w);
			}
		}
	}
	for(int i=81;i<=120;i++){
		a.push_back(i);
		b.push_back(i+1);
	}
	
	rep(i,40){
		if((aa>>i)&1){
			a.push_back(41 + i);
			b.push_back(81 + i + 1);
			a.push_back(1 + i);
			b.push_back(81 + i + 1);
		}
	}
	
	
	
	cout<<122<<' '<<a.size()<<endl;
	rep(i,a.size()){
		cout<<a[i]+1<<' '<<b[i]+1<<endl;
	}
		//cout<<get(a,b)<<endl;
	
	return 0;
}
0