結果
| 問題 |
No.280 歯車の問題(1)
|
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2015-09-18 22:32:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 801 bytes |
| コンパイル時間 | 847 ms |
| コンパイル使用メモリ | 97,552 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 07:00:09 |
| 合計ジャッジ時間 | 3,311 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:33:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
33 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
main.cpp:37:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
37 | scanf("%lld", &a);
| ~~~~~^~~~~~~~~~~~
ソースコード
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
#include<unordered_set>
//#include<quadmath.h>
using namespace std;
int main(){
int n;
scanf("%d", &n);
vector<long long int> v;
for (int i = 0; i < n; i++){
long long int a;
scanf("%lld", &a);
v.push_back(a);
}
long long int k = __gcd(v[0], v.back());
v[0] /= k;
v.back() /= k;
printf("%lld/%lld\n", v.back(), v[0]);
return 0;
}
Kmcode1