結果
問題 | No.632 穴埋め門松列 |
ユーザー |
![]() |
提出日時 | 2018-12-15 00:17:05 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,304 bytes |
コンパイル時間 | 1,385 ms |
コンパイル使用メモリ | 159,668 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-25 05:28:28 |
合計ジャッジ時間 | 1,741 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,944 KB |
testcase_04 | AC | 2 ms
6,944 KB |
testcase_05 | AC | 2 ms
6,944 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:55:14: warning: ‘c2’ may be used uninitialized in this function [-Wmaybe-uninitialized] 55 | else if (l2 < c2&&c2 > r2)cout << 4; | ^~ main.cpp:28:13: warning: ‘l2’ may be used uninitialized in this function [-Wmaybe-uninitialized] 28 | int l2, c2, r2; | ^~ main.cpp:53:14: warning: ‘c1’ may be used uninitialized in this function [-Wmaybe-uninitialized] 53 | else if(l1 < c1&&c1 > r1)cout << 1; | ^~ main.cpp:27:13: warning: ‘l1’ may be used uninitialized in this function [-Wmaybe-uninitialized] 27 | int l1, c1, r1; | ^~
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<int(n); i++) #define FOR(i,m,n) for(int i=int(m); i<int(n); i++) #define ALL(obj) (obj).begin(),(obj).end() #define VI vector<int> #define VLL vector<long long> #define VVI vector<vector<int>> #define VVLL vector<vector<long long>> #define VC vector<char> #define VS vector<string> #define VVC vector<vector<char>> #define fore(i,a) for(auto &i:a) typedef long long ll; typedef pair <int, int> P; template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = 2147483647; const ll INFL = 9223372036854775807; const ll mod = 1000000007; int main() { int l1, c1, r1; int l2, c2, r2; REP(i, 3) { char c; cin >> c; if (i == 0) { if (c == '?') { l1 = 1; l2 = 4; } else l1 = l2 = c - '0'; }else if (i == 1) { if (c == '?') { c1 = 1; c2 = 4; } else c1 = c2 = c - '0'; }else if (i == 2) { if (c == '?') { r1 = 1; r2 = 4; } else r1 = r2 = c - '0'; } } if (l1 > c1&&c1 < r1)cout << 1; else if(l1 < c1&&c1 > r1)cout << 1; if (l2 > c2&&c2 < r2)cout << 4; else if (l2 < c2&&c2 > r2)cout << 4; cout << endl; return 0; }