結果
問題 | No.83 最大マッチング |
ユーザー |
![]() |
提出日時 | 2022-12-16 09:40:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 109 ms / 5,000 ms |
コード長 | 3,389 bytes |
コンパイル時間 | 936 ms |
コンパイル使用メモリ | 99,440 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-15 14:41:10 |
合計ジャッジ時間 | 1,847 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
// yukicodr// No.83//二次元可変配列//vector <vector <int>> mass;//vector <vector <int>> memo;//vector <int> memo;//#include "stdafx.h"#include <iostream>#include <vector>#include <list>//list#include <queue> //queue#include <set> //連想コンテナ(要素が自動でソートされる)、要素1つ(Key)、keyの重複ない、O(logN)#include <map> //連想コンテナ(要素が自動でソートされる)、要素2つ(Key,data)、keyの重複ない、dataは重複あり、O(logN)#include <unordered_set> //hash、O(1)#include <unordered_map> //hash、O(1)#include <algorithm>#include <iomanip>#include <cstring>#include <string>#include <climits>//#include <bits/stdc++.h>using namespace std;#define FOR(x,to) for(x=0;x<to;x++)#define ZERO(a) memset(a,0,sizeof(a))#define MINUS(a) memset(a,0xff,sizeof(a))#define FMAX(a,b) ((a)>(b)?(a):(b))#define FMIN(a,b) ((a)<(b)?(a):(b))#define FCEIL(a,b) ((a)+(b)-1)/(b)typedef unsigned long long ULL;typedef signed long long SLL;queue<int> _queue;//昇順int compare_up(const int * a, const int *b){if (*a > *b)return (1);else if (*a < *b)return (-1);return (0);}//降順int compare_down(const int * a, const int *b){if (*a > *b)return (-1);else if (*a < *b)return (1);return (0);}int par[3005 * 3005]; //ルートの番号int _rank[3005 * 3005]; //木の高さint flag[3005 * 3005];// 経路圧縮// 直列で連結しているような木はすべて直接ルートにつなぐようにするint _find(int x){if (x == par[x]){//cout << "x=" << x << endl;return x;}else{int a;//cout << "in->" << endl;a = _find(par[x]);//cout << "<-out" << endl;//cout << "x=" << x << ",par[x]=" << par[x] << ",a=" << a << endl;//ルートを更新(圧縮)par[x] = a;//新しいルートを返すreturn par[x];}}//xとyが同じ集合かどうかbool same(int x, int y){//ルートが同じかどうかを判定すればOKreturn _find(x) == _find(y);}//初期化//はじめは全部の頂点がルートvoid init(int n){for (int i = 0; i < n; i++){par[i] = i;_rank[i] = 0;}}// x と y を同じツリーにするvoid _union(int x, int y){int root_x;int root_y;root_x = _find(x);root_y = _find(y);if (root_x == root_y) return; //最初から同じルートならすぐ返す//木の高さが高いほうの木の根に、低いほうの根をつなげるif (_rank[root_x] < _rank[root_y]){// x<yのときpar[root_x] = root_y;}else{// x>y または x==y のとき// yをxにつなげるpar[root_y] = root_x;// 高さが同じときだけ 高さを変える必要があるif (_rank[root_x] == _rank[root_y])_rank[root_x]++; // つなげられた木の高さを1つふやす(全体の木の高さは1増える)}}int solve(int i, ULL index_flag){;return 0;}int main(){int flag = 0;ULL n;ULL keta;cin >> n; //2<=N<=100000if (n == 2){cout << 1; return 0;}if (n == 3){cout << 7; return 0;}//文字列操作string _s, _id;//_s.size();//_s.empty();if (n % 2)flag = 1;keta = n / 2;for (ULL i = 0; i < keta; i++){if (flag && (i == 0))_s = _s + "7";else_s = _s + "1";}cout << _s << endl;//getchar();return 0;}