結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー akun0716akun0716
提出日時 2018-12-09 22:02:08
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 61,468 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 21:56:30
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 1 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,352 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:12: warning: NULL used in arithmetic [-Wpointer-arith]
   if(A[1]!=NULL){
            ^~~~
main.cpp:20:12: warning: NULL used in arithmetic [-Wpointer-arith]
   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