結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
|
| 提出日時 | 2019-09-16 03:27:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 991 bytes |
| コンパイル時間 | 697 ms |
| コンパイル使用メモリ | 75,484 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 22:58:47 |
| 合計ジャッジ時間 | 1,206 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 3 |
| other | AC * 5 WA * 8 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long int ll;
int main(){
string s,t; cin >> s >> t;
bool ok=true;
int n=s.size(); int m=t.size();
if(s[0]=='0'&&n>1){
ok=false;
}
if(t[0]=='0'&&m>1){
ok=false;
}
for(int i=0;i<n;i++){
if('0'<=s[i]&&s[i]<='9'){
continue;
}
else{
ok=false;
}
}
for(int i=0;i<m;i++){
if('0'<=t[i]&&t[i]<='9'){
continue;
}
else{
ok=false;
}
}
if(n==5){
int q=0;
for(int i=0;i<5;i++){
q+=(s[i]-'0')*pow(10,4-i);
}
if(q>12345)ok=false;
}
if(m==5){
int q=0;
for(int i=0;i<5;i++){
q+=(t[i]-'0')*pow(10,4-i);
}
if(q>12345)ok=false;
}
if(ok){
cout << "OK" << endl;
}
else{
cout << "NO" << endl;
}
}