結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー kotamanegi
提出日時 2016-11-18 22:25:45
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 956 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 85,824 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-26 06:36:49
合計ジャッジ時間 1,278 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define LONGINF 1000000000000000000
int main() {
	string hoge;
	REP(to, 2) {
		cin >> hoge;
		for (int i = 0;i < hoge.length();++i) {
			if (i == 0 && hoge[i] == '0') {
				if (hoge.length() == 1) {
					goto oh;
				}
				cout << "NG" << endl;
				return 0;
			}
			for (int q = 1;q <= i+1;++q) {
				if (hoge[i] == '0' + q) {
					goto ok;
				}
			}
			cout << "NG" << endl;
			return 0;
		ok:;
		}
	oh:;
	}
	cout << "OK" << endl;
	return 0;
}
0