結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2015-10-23 22:37:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 390 bytes |
コンパイル時間 | 309 ms |
コンパイル使用メモリ | 34,140 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-23 01:28:11 |
合計ジャッジ時間 | 1,171 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 12 WA * 8 |
コンパイルメッセージ
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;//namaega184int main(){char a[100001],b[100001];scanf("%s%s",a,b);int la=strlen(a),lb=strlen(b);if(la<lb){a:printf("%s\n",b);return 0;}else if(la>lb){b:printf("%s\n",a);return 0;}else{for(int i=0;i<la;i++){if(a[i]<b[i])goto b;else if(a[i]>b[i])goto a;}}printf("-1\n");return 0;}