結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー d_seid_sei
提出日時 2019-10-14 21:52:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,288 bytes
コンパイル時間 857 ms
コンパイル使用メモリ 82,008 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 01:47:56
合計ジャッジ時間 1,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
int main() {
	string A, B;
	cin >> A >> B;
	int a = A.size();
	int b = B.size();
	int ja = 0;
	int jb = 0;
	int AA = 0;
	int BB = 0;

	for (int ia = 0; ia < a; ia++) {
		if (A.at(ia) != '0' &&
			A.at(ia) != '1' &&
			A.at(ia) != '2' &&
			A.at(ia) != '3' &&
			A.at(ia) != '4' &&
			A.at(ia) != '5' &&
			A.at(ia) != '6' &&
			A.at(ia) != '7' &&
			A.at(ia) != '8' &&
			A.at(ia) != '9') {
			ja++;
		}
	}
	if (!ja) {
		for (int ja = 0; ja < a; ja++) {
			AA += (A.at(ja) - '0') * pow(10, (a - ja - 1));
		}
		if (AA && A.at(0) == '0') {
			ja++;
		}
		if (AA > 12345) {
			ja++;
		}
	}

	for (int ib = 0; ib < b; ib++) {
		if (B.at(ib) != '0' &&
			B.at(ib) != '1' &&
			B.at(ib) != '2' &&
			B.at(ib) != '3' &&
			B.at(ib) != '4' &&
			B.at(ib) != '5' &&
			B.at(ib) != '6' &&
			B.at(ib) != '7' &&
			B.at(ib) != '8' &&
			B.at(ib) != '9') {
			jb++;
		}
	}
	if (!jb) {
		for (int jb = 0; jb < b; jb++) {
			BB += (B.at(jb) - '0') * pow(10, (b - jb - 1));
		}
		if (BB && B.at(0) == '0') {
			jb++;
		}
		if (BB > 12345) {
			jb++;
		}
	}


	if (!ja && !jb) {
		cout << "OK" << endl;
	}
	else {
		cout << "NG" << endl;
	}
}




0