結果
問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
ユーザー |
![]() |
提出日時 | 2018-04-06 03:19:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 592 bytes |
コンパイル時間 | 470 ms |
コンパイル使用メモリ | 60,364 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 10:43:28 |
合計ジャッジ時間 | 1,207 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’: main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 21 | scanf("%s %s", A, B); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <algorithm> #include <vector> #include <deque> #include <string> #include <iostream> using namespace std; using ll = long long; void solve(); int main() { solve(); #ifdef DBG while (true); #endif } //446 void solve() { char A[6], B[6]; scanf("%s %s", A, B); bool f = true; if (A[0] == '0' && A[1] != 0) f = false; if (B[0] == '0' && B[1] != 0) f = false; for (int i = 0; A[i]; i++) if (!('0' <= A[i] && A[i] <= '9')) f = false; for (int i = 0; B[i]; i++) if (!('0' <= B[i] && B[i] <= '9')) f = false; printf("%s\n", f ? "OK" : "NG"); }