結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー mkanmkan
提出日時 2017-02-05 09:50:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 52,836 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 20:24:53
合計ジャッジ時間 1,299 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdlib>
using namespace std;

int digit(int n){
	int cnt=0;
	if(n==0) return 1;
	while(n%10!=0){
		cnt++;
		n/=10;
	}
	return cnt;
}

int main(){
	int flaga=0,flagb=0;
	string a,b;
	cin>>a>>b;
	int aa=atoi(a.data());
	int bb=atoi(b.data());
	if(a.size()!=digit(aa)||b.size()!=digit(bb)){
		cout<<"NG"<<endl;
	}else if(aa>=0&&aa<=12345&&bb>=0&&bb<=12345){
		cout<<"OK"<<endl;
	}else{
		cout<<"NG"<<endl;
	}
	return 0;
}
0