結果
| 問題 |
No.83 最大マッチング
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-04 23:48:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| コンパイル時間 | 696 ms |
| コンパイル使用メモリ | 63,400 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-14 23:56:59 |
| 合計ジャッジ時間 | 1,236 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 7 |
ソースコード
#include<iostream>
#include<queue>
using namespace std;
int main(void){
int n;
int dig;
int match;
queue<int> que;
cin>>n;
dig=1;
match=0;
while(n>0){
if(n%2==1&&n-3>=0){
n=n-3;
que.push(7);
}else if(n-2>=0){
n=n-2;
que.push(1);
}else{
break;
}
}
while(!que.empty()){
match+=que.front()*dig;
que.pop();
dig=dig*10;
}
cout << match << '\n';
return 0;
}