結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| コンテスト | |
| ユーザー |
moyashi_senpai
|
| 提出日時 | 2016-11-18 22:32:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,497 bytes |
| コンパイル時間 | 623 ms |
| コンパイル使用メモリ | 87,744 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-26 07:13:40 |
| 合計ジャッジ時間 | 1,186 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:43:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
43 | scanf("%s", str);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define POWT(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b) ((a >> b) & 1)
#define bitset(a,b) ( a |= (1 << b))
#define bitunset(a,b) (a &= ~(1 << b))
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const pii Dir[8] = { //?????????
{ 0,1 },{ 0,-1 },{ 1,0 },{ -1,0 },
{ 1,1 },{ 1,-1 },{ -1,-1 },{ -1,1 }
};
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
std::fill((T*) array, (T*) (array + N), val);
}
signed main() {
REP(cc, 2) {
char str[6];
scanf("%s", str);
bool f = 0;
if (str[0] != '0') {
bool f2 = 1;
REP(i, strlen(str)) {
if (!RANGE(str[i], '0', '9')) {
f2 = 0;
break;
}
}
if (f2) {
int num = atoi(str);
if (num <= 12345)
f = 1;
}
}
else if (str[0] == '0' && strlen(str) == 1) {
f = 1;
}
if (!f) {
printf("NG\n");
return 0;
}
}
printf("OK\n");
return 0;
}
moyashi_senpai