結果

問題 No.438 Cwwプログラミング入門
ユーザー kitayankitayan
提出日時 2016-11-08 13:12:54
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,561 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 55,388 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-03 23:17:01
合計ジャッジ時間 7,487 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
testcase_28 RE -
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 2 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 1 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 RE -
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 1 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 AC 2 ms
5,376 KB
testcase_50 AC 1 ms
5,376 KB
testcase_51 WA -
testcase_52 AC 2 ms
5,376 KB
testcase_53 AC 2 ms
5,376 KB
testcase_54 AC 2 ms
5,376 KB
testcase_55 AC 2 ms
5,376 KB
testcase_56 AC 2 ms
5,376 KB
testcase_57 AC 1 ms
5,376 KB
testcase_58 AC 2 ms
5,376 KB
testcase_59 AC 1 ms
5,376 KB
testcase_60 AC 2 ms
5,376 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 2 ms
5,376 KB
testcase_63 AC 2 ms
5,376 KB
testcase_64 AC 2 ms
5,376 KB
testcase_65 AC 2 ms
5,376 KB
testcase_66 AC 1 ms
5,376 KB
testcase_67 AC 1 ms
5,376 KB
testcase_68 WA -
testcase_69 AC 2 ms
5,376 KB
testcase_70 AC 2 ms
5,376 KB
testcase_71 AC 2 ms
5,376 KB
testcase_72 AC 2 ms
5,376 KB
testcase_73 AC 2 ms
5,376 KB
testcase_74 AC 2 ms
5,376 KB
testcase_75 AC 1 ms
5,376 KB
testcase_76 WA -
testcase_77 AC 2 ms
5,376 KB
testcase_78 AC 2 ms
5,376 KB
testcase_79 AC 2 ms
5,376 KB
testcase_80 AC 1 ms
5,376 KB
testcase_81 AC 2 ms
5,376 KB
testcase_82 AC 1 ms
5,376 KB
testcase_83 AC 1 ms
5,376 KB
testcase_84 AC 1 ms
5,376 KB
testcase_85 AC 2 ms
5,376 KB
testcase_86 AC 1 ms
5,376 KB
testcase_87 AC 2 ms
5,376 KB
testcase_88 AC 1 ms
5,376 KB
testcase_89 RE -
testcase_90 RE -
testcase_91 AC 2 ms
5,376 KB
testcase_92 AC 1 ms
5,376 KB
testcase_93 RE -
testcase_94 RE -
testcase_95 WA -
testcase_96 AC 2 ms
5,376 KB
testcase_97 WA -
testcase_98 AC 1 ms
5,376 KB
testcase_99 AC 1 ms
5,376 KB
testcase_100 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:64:26: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   64 |         for(int i = 0; i < a; i++){
      |                        ~~^~~

ソースコード

diff #

//
//  438.cpp
//  yukicoder
//
//  Created by KITAZUMI on 2016/11/08.
//  Copyright © 2016年 KITAZUMI. All rights reserved.
//

#include<iostream>

using namespace std;

int main(){
    int a, b, x, y, z;
    int amari;
    cin >> x >> y >> z;
    
    for(b = 0; b <= 5000; b++){
        amari = (z - b * y) % x;
        if(amari == 0){
            a = (z - b * y) / x;
            break;
        }
        amari = (z + b * y) % x;
        if(amari == 0){
            a = (z + b * y) / x;
            b = -b;
            break;
        }
    }
    if(2*a+2*b-1 > 10000){
        cout << "NO" << endl;
        return 0;
    }
    if(a >= 0 && b >= 0){
        for(int i = 0; i < a; i++){
            cout << "c";
        }
        for(int i = 0; i < b; i++){
            cout << "w";
        }
        for(int i = 0; i < a+b-1; i++){
            cout << "C";
        }
    }
    else if(a < 0 && b >= 0){
        for(int i = 0 ; i < -a; i++){
            cout << "c";
        }
        for(int i = 0; i < b; i++){
            cout << "w";
        }
        for(int i = 0; i < b-1; i++){
            cout << "C";
        }
        for(int i = 0; i < -a; i++){
            cout << "W";
        }
    }
    else if(a >= 0 && b < 0){
        for(int i = 0; i < -b; i++){
            cout << "w";
        }
        for(int i = 0; i < a; i++){
            cout << "c";
        }
        for(int i = 0; i < a-1; i++){
            cout << "C";
        }
        for(int i = 0; i < -b; i++){
            cout << "W";
        }
    }
    cout << endl;
    return 0;
}
0