結果
| 問題 | No.3454 Zodiac |
| コンテスト | |
| ユーザー |
Taiki0715
|
| 提出日時 | 2026-03-07 19:31:18 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,412 bytes |
| 記録 | |
| コンパイル時間 | 4,314 ms |
| コンパイル使用メモリ | 375,356 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-07 19:31:25 |
| 合計ジャッジ時間 | 4,819 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include "bits/stdc++.h"
#include "atcoder/all"
using namespace std;
using namespace atcoder;
using ll=long long;
using mint=modint998244353;
#define rep3(i,a,b) for(int i=a;i<(b);i++)
#define rep2(i,n) rep3(i,0,n)
#define overload(a,b,c,d,...) d
#define rep(...) overload(__VA_ARGS__,rep3,rep2)(__VA_ARGS__)
#define all(x) x.begin(),x.end()
template<typename T>
istream&operator>>(istream&is,vector<T>&a){
for(T&x:a)is>>x;
return is;
}
template<typename T>
ostream&operator<<(ostream&os,const vector<T>&a){
os<<'{';
for(const T&x:a)os<<x<<',';
os<<'}';
return os;
}
template<typename T>
void operator++(vector<T>&a,int){
for(T&x:a)x++;
}
template<typename T>bool chmin(T&a,T b){
if(a>b){
a=b;
return true;
}
return false;
}
template<typename T>bool chmax(T&a,T b){
if(a<b){
a=b;
return true;
}
return false;
}
#ifdef LOCAL
template<typename T>
void debug_rec(T a){
cerr<<' '<<a<<'\n';
}
template<typename T1,typename... T2>
void debug_rec(T1 a,T2... b){
cerr<<' '<<a;
debug_rec(b...);
}
template<typename T1,typename... T2>
void debug(T1 a,T2... b){
cerr<<"debug";
debug_rec(a,b...);
}
#else
#define debug(...)
#endif
int sol(int y0,int y,int p0,int p){
while(y0<y){
y0++;
p0++;
if(p0==p+1)p0=1;
}
while(y0>y){
y0--;
p0--;
if(p0==0)p0=p;
}
return p0;
}
int main(){
int p,q,y0,p0,q0,y;
cin>>p>>q>>y0>>p0>>q0>>y;
cout<<sol(y0,y,p0,p)<<' '<<sol(y0,y,q0,q)<<endl;
}
Taiki0715