結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー akun0716
提出日時 2018-12-09 22:02:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 60,764 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 15:37:46
合計ジャッジ時間 1,264 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 11 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:26: warning: NULL used in arithmetic [-Wpointer-arith]
   14 |                 if(A[1]!=NULL){
      |                          ^~~~
main.cpp:20:26: warning: NULL used in arithmetic [-Wpointer-arith]
   20 |                 if(B[1]!=NULL){
      |                          ^~~~

ソースコード

diff #

#include <iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	string A,B;
	cin>>A>>B;
	if(A[0]=='0'){
		if(A[1]!=NULL){
			cout<<"NG"<<endl;
			return 0;
		}
	}
	if(B[0]=='0'){
		if(B[1]!=NULL){
			cout<<"NG"<<endl;
			return 0;
		}
	}
	REP(i,A.size()){
		if(A[i]>=65 && A[i]<=90){
			cout<<"NG"<<endl;
			return 0;
		}
		if(A[i]>=97 && A[i]<=122){
			cout<<"NG"<<endl;
			return 0;
		}
	}
	REP(i,B.size()){
		if(B[i]>=65 && B[i]<=90){
			cout<<"NG"<<endl;
			return 0;
		}
		if(B[i]>=97 && B[i]<=122){
			cout<<"NG"<<endl;
			return 0;
		}
	}
	cout<<"OK"<<endl;
	
	return 0;
}
0