結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー KKT89KKT89
提出日時 2019-09-16 03:27:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 991 bytes
コンパイル時間 675 ms
コンパイル使用メモリ 74,424 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2023-09-21 04:22:05
合計ジャッジ時間 1,781 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
    string s,t; cin >> s >> t;
    bool ok=true;
    int n=s.size(); int m=t.size();
    if(s[0]=='0'&&n>1){
        ok=false;
    }
    if(t[0]=='0'&&m>1){
        ok=false;
    }
    for(int i=0;i<n;i++){
        if('0'<=s[i]&&s[i]<='9'){
            continue;
        }
        else{
            ok=false;
        }
    }
    for(int i=0;i<m;i++){
        if('0'<=t[i]&&t[i]<='9'){
            continue;
        }
        else{
            ok=false;
        }
    }
    if(n==5){
        int q=0;
        for(int i=0;i<5;i++){
            q+=(s[i]-'0')*pow(10,4-i);
        }
        if(q>12345)ok=false;
    }
    if(m==5){
        int q=0;
        for(int i=0;i<5;i++){
            q+=(t[i]-'0')*pow(10,4-i);
        }
        if(q>12345)ok=false;
    }
    if(ok){
        cout << "OK" << endl;
    }
    else{
        cout << "NO" << endl;
    }
}
0