結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2018-12-09 22:16:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 962 bytes |
コンパイル時間 | 449 ms |
コンパイル使用メモリ | 61,336 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-16 15:37:54 |
合計ジャッジ時間 | 1,064 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 12 WA * 1 |
コンパイルメッセージ
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){ | ^~~~ main.cpp:46:18: warning: NULL used in arithmetic [-Wpointer-arith] 46 | if(A[4]!=NULL){ | ^~~~ main.cpp:53:18: warning: NULL used in arithmetic [-Wpointer-arith] 53 | if(B[4]!=NULL){ | ^~~~
ソースコード
#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; }