結果
| 問題 |
No.293 4>7の世界
|
| コンテスト | |
| ユーザー |
184
|
| 提出日時 | 2015-10-23 22:41:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 434 bytes |
| コンパイル時間 | 221 ms |
| コンパイル使用メモリ | 34,560 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-23 01:39:10 |
| 合計ジャッジ時間 | 995 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 17 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | char a[100001],b[100001];scanf("%s%s",a,b);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
//namaega184
int main(){
char a[100001],b[100001];scanf("%s%s",a,b);
int la=strlen(a),lb=strlen(b);
if(la<lb){b:printf("%s\n",b);return 0;}
else if(la>lb){a:printf("%s\n",a);return 0;}
else{
for(int i=0;i<la;i++){
if(a[i]=='7'&&b[i]=='4'||a[i]<b[i])goto b;
else if(a[i]=='4'&&b[i]=='7'||a[i]>b[i])goto a;
}
}
printf("-1\n");
return 0;
}
184