結果
| 問題 | 
                            No.83 最大マッチング
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Lay_ec
                         | 
                    
| 提出日時 | 2014-12-02 23:40:02 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 701 bytes | 
| コンパイル時間 | 690 ms | 
| コンパイル使用メモリ | 71,432 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-11 07:45:12 | 
| 合計ジャッジ時間 | 1,258 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 4 WA * 6 | 
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
using namespace std;
int main()
{	
	int n,nn;
	cin>>n;
	unsigned long long res=0,res2=0;
	if(n==3) res=7;
	else{
		nn=n;
		while(nn>=2){res*=10;res+=1; nn-=2;}
		nn=n;
		while(nn>=3){res2*=10;res2+=7; nn-=3;}
		while(nn>=2){res2*=10;res2+=1; nn-=2;}
		res=max(res,res2);
		nn=n; res2=0;
		while(nn>=6){res2*=10;res2+=9; nn-=6;}
		while(nn>=3){res2*=10;res2+=7; nn-=3;}
		while(nn>=2){res2*=10;res2+=1; nn-=2;}
		res=max(res,res2);
	}
	cout<<res<<endl;
	return 0;
}
            
            
            
        
            
Lay_ec