結果

問題 No.687 E869120 and Constructing Array 1
ユーザー mostfamousofmostfamousof
提出日時 2020-02-22 16:39:15
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 1,460 ms
コンパイル使用メモリ 163,840 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 23:35:39
合計ジャッジ時間 2,627 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
6,940 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:10:17: warning: 'a' is used uninitialized [-Wuninitialized]
   10 |     while(a + b != N){
      |           ~~~~~~^~~~
main.cpp:9:9: note: 'a' was declared here
    9 |     int a, b = 0;
      |         ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    int N = 0;
    cin >> N;
    int a, b = 0;
    while(a + b != N){
            if(a < 10){
                a++;
            }
            else{
                b++;
            }
        }
    cout << a << " " << b << endl;
}
0