結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
akun0716
|
| 提出日時 | 2018-12-09 22:11:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 872 bytes |
| コンパイル時間 | 777 ms |
| コンパイル使用メモリ | 62,176 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-16 15:37:53 |
| 合計ジャッジ時間 | 1,182 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 8 WA * 5 |
コンパイルメッセージ
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){
| ^~~~
ソースコード
#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;
}
}
int a=A[0]*10000+A[1]*1000+A[2]*100+A[3]*10+A[4]*1;
int b=B[0]*10000+B[1]*1000+B[2]*100+B[3]*10+B[4]*1;
if(a>12345 || b>12345){
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;
}
akun0716