結果
| 問題 |
No.632 穴埋め門松列
|
| コンテスト | |
| ユーザー |
🍮かんプリン
|
| 提出日時 | 2019-02-21 17:48:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 608 bytes |
| コンパイル時間 | 1,345 ms |
| コンパイル使用メモリ | 157,676 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-19 04:48:17 |
| 合計ジャッジ時間 | 1,808 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%c %c %c",&c[0],&c[1],&c[2]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
char c[3];
scanf("%c %c %c",&c[0],&c[1],&c[2]);
rep(i,3) {
if(c[i]=='?')
c[i]='1';
}
if ((c[0]>c[1]&&c[1]<c[2])||(c[0]<c[1]&&c[1]>c[2])) {
cout << 1;
}
rep(i,3) {
if(c[i]=='1')
c[i]='4';
}
if ((c[0]>c[1]&&c[1]<c[2])||(c[0]<c[1]&&c[1]>c[2])) {
cout << 4;
}
cout << endl;
return 0;
}
🍮かんプリン