結果

問題 No.83 最大マッチング
ユーザー hamrayhamray
提出日時 2017-11-23 12:12:45
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 471 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 144,800 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-18 03:01:56
合計ジャッジ時間 8,350 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){  
    int N; cin >> N;
    string S = "";
    if(N % 2 == 0){
        while(true){
            if(N / 2 >= 1){
                S += "1"; N /= 2;
            }
            if(N / 2 < 1) break;
        }
    }else{
        while(true){
        if(N == 3){
            S += "7"; break;
        }
        if(N / 2 > 0){
            S += "1"; N /= 2;
            }
        }
    }
    cout << S << endl;
    return 0;
}
0