結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー mkan
提出日時 2017-02-05 09:50:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 55,420 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 06:30:58
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 12 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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