結果

問題 No.83 最大マッチング
ユーザー FSM
提出日時 2019-11-01 17:02:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 264 bytes
コンパイル時間 1,402 ms
コンパイル使用メモリ 158,024 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 22:46:12
合計ジャッジ時間 2,027 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:18: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |     std::cout << ans << std::endl;
      |                  ^~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int A,ans;
    std::cin >>A ;
    for (auto i=0 ;i<A/2;i++) {
        ans+=pow(10,i);
        if  (A%2==1&&(A-1)/2==i){
            ans+=pow(10,i)*6;
        }
    }
    std::cout << ans << std::endl;
}
0