結果

問題 No.1236 長針と短針
ユーザー クケクケ
提出日時 2020-10-16 16:14:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,924 bytes
コンパイル時間 797 ms
コンパイル使用メモリ 97,492 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-20 20:55:45
合計ジャッジ時間 1,640 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'long long int lcm(std::vector<long long int>)':
main.cpp:74:145: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized]
   74 | ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;}
      |                                                                                                                                                 ^
main.cpp:74:25: note: 'n' was declared here
   74 | ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;}
      |                         ^

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<list>
#define ll long long
#define str string
#define ld long double
#define vec vector
#define vll vec<ll>
#define vvll vec<vll>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(ll i=b;i>=a;i--)
#define repset(itr,a) for(auto itr=a.begin();itr!=a.end();itr++)
#define repnck(bit,n,k) for(ll bit=(1<<(k))-1;bit<(1<<(n));bit=nec(bit))
#define bi1(bit,i) ((bit)&1<<(i)?true:false)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define kai "\n"
#define prque priority_queue
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mie min_element
#define mae max_element
#define tos to_string
#define sep setprecision
#define lob lower_bound
#define upb upper_bound
#define bis binary_search
#define nep next_permutation
#define MOD 1000000007ll
#define MAX 2147483647
#define MIN (1e-10)
#define equal(a,b) (abs((a)-(b))<MIN)
using namespace std;
void solve();
struct ll2{ll x,y;bool operator<(const ll2 &l)const{return x!=l.x?x<l.x:y<l.y;};};
struct ll3{ll x,y,z;bool operator<(const ll3 &l)const{if(x!=l.x)return x<l.x;if(y!=l.y)return y<l.y;return z<l.z;};};

class ufset{
public:
	ufset(ll n) {rank.resize(n,0);rep(i,0,n)p.pub(i);}
	bool same(ll i,ll j){return find(i)==find(j);}
	void unite(ll i,ll j){link(find(i),find(j));}
private:
  vll rank,p;
	void link(ll i,ll j){if(rank[i]>rank[j])p[j]=i;else{p[i]=j;if(rank[i]==rank[j])rank[j]++;}}
	ll find(ll i){if(i!=p[i])p[i]=find(p[i]);return p[i];}
};

class nck{
public:
	nck(ll maxn,ll mod=MOD){
		NUM=maxn+1;p=mod;
		fac.resize(NUM);finv.resize(NUM);inv.resize(NUM);
		fac[0]=fac[1]=finv[0]=finv[1]=inv[1]=1;
		rep(i,2,NUM){fac[i]=fac[i-1]*i%p;inv[i]=p-inv[p%i]*(p/i)%p;finv[i]=finv[i-1]*inv[i]%p;}
	}
	ll c(ll n,ll k){return fac[n]*(finv[k]*finv[n-k]%p)%p;}
private:
  ll NUM,p;
	vll fac,finv,inv;
};

ll gcd(vector<ll> a){rep(i,1,a.size()){ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}}return a.back();}
ll lcm(vector<ll> a){ll n;rep(i,1,a.size()){n=a[i-1]*a[i];ll k=a[i-1]%a[i];while(k!=0){a[i-1]=a[i];a[i]=k;k=a[i-1]%a[i];}n/=a[i];a[i]=n;}return n;}
ll pow2(ll a,ll b,ll p=MOD){if(b==-1)return pow2(a,p-2);ll res=1;if(b>0){res=pow2(a,b/2);if(b%2==0)res=res*res%p;else res=res*res%p*a%p;}return res;}
ll nec(ll bit){ll x=bit&-bit,y=bit+x;return (((bit&~y)/x)>>1)|y;}
ll bisz(ll bit){ll size=0;while(bit>0){bit/=2;size++;}return size;}
ll ransu(){static unsigned int TX=123456789, TY=362436069, TZ=521288629, TW=88675123;unsigned int tt=(TX^(TX<<11));TX=TY;TY=TZ;TZ=TW;return (TW=(TW^(TW>>19))^(tt^(tt>>8)));}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed;
	solve();
}

void solve(){
	ll a,b;cin>>a>>b;
	ll d=((a%12)*30-(b*60)+360)%360;
	cout<<(ll)(1.0*d/(0.1-1/120))<<kai;
}
0