結果
| 問題 | No.280 歯車の問題(1) |
| コンテスト | |
| ユーザー |
sntea
|
| 提出日時 | 2015-09-20 03:34:16 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 793 bytes |
| 記録 | |
| コンパイル時間 | 718 ms |
| コンパイル使用メモリ | 79,780 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 08:16:13 |
| 合計ジャッジ時間 | 3,009 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:42:18: warning: ‘b’ may be used uninitialized in this function [-Wmaybe-uninitialized]
42 | cout<<b<<'/'<<a<<endl;
| ^~~
main.cpp:15:14: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
15 | #define endl '\n'
| ^~~~
main.cpp:35:13: note: ‘a’ was declared here
35 | int a,b;
| ^
ソースコード
#include <iostream>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <utility>
#define endl '\n'
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define DEBUG(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef pair<int,int> P;
typedef long long int LL;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int N;
cin>>N;
int a,b;
REP(i,N){
int x;
cin>>x;
if(i==0) a=x;
if(i==N-1) b=x;
}
cout<<b<<'/'<<a<<endl;
return 0;
}
sntea