結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー akun0716akun0716
提出日時 2018-12-09 22:16:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 962 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 62,912 KB
実行使用メモリ 5,196 KB
最終ジャッジ日時 2023-10-14 21:56:40
合計ジャッジ時間 1,432 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,356 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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){
            ^~~~
main.cpp:46:11: warning: NULL used in arithmetic [-Wpointer-arith]
  if(A[4]!=NULL){
           ^~~~
main.cpp:53:11: warning: NULL used in arithmetic [-Wpointer-arith]
  if(B[4]!=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;
		}
	}
	if(A[4]!=NULL){
		int a=A[0]*10000+A[1]*1000+A[2]*100+A[3]*10+A[4]*1;
		if(a>12345){
			cout<<"NG"<<endl;
			return 0;
		}
	}
	if(B[4]!=NULL){
		
		int b=B[0]*10000+B[1]*1000+B[2]*100+B[3]*10+B[4]*1;
		if(b>12345){
			cout<<"NG"<<endl;
			return 0;
		}
	}
		cout<<"OK"<<endl;
	
	return 0;
}
0