結果
| 問題 | No.1624 三角形の反射 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-07-23 22:43:45 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 1,941 bytes | 
| コンパイル時間 | 1,998 ms | 
| コンパイル使用メモリ | 202,352 KB | 
| 最終ジャッジ日時 | 2025-01-23 08:28:20 | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:61:5: warning: ‘x’ may be used uninitialized [-Wmaybe-uninitialized]
   61 |     if (x<y) swap(x, y);
      |     ^~
main.cpp:50:8: note: ‘x’ was declared here
   50 |     ll x,y;
      |        ^
main.cpp:61:5: warning: ‘y’ may be used uninitialized [-Wmaybe-uninitialized]
   61 |     if (x<y) swap(x, y);
      |     ^~
main.cpp:50:10: note: ‘y’ was declared here
   50 |     ll x,y;
      |          ^
            
            ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define fore(i_in,a) for (auto& i_in: a)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define cnts(x,c) count(all(x),c)
#define fio() cin.tie(nullptr);ios::sync_with_stdio(false);
#define DEBUG_CTN(v) cerr<<#v<<":";for(auto itr=v.begin();itr!=v.end();itr++) cerr<<" "<<*itr; cerr<<endl
template<class T> bool chmax(T &a, const T &b) {if (a<b) {a = b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b) {if (a>b) {a = b; return 1;} return 0;}
template<class T> void print(const T &t) {cout<<t<<"\n";}
template<class T> void PRINT(const T &t) {rep(i,sz(t)) cout<<t[i]<<" \n"[i==sz(t)-1];}
const ll INF = 1LL << 62;
const int iINF = 1 << 30;
using mat = vector<vl>;
mat mat_mul(mat a, mat b) {
    mat res(sz(a), vl(sz(b[0])));
    rep(i,sz(a)) rep(j,sz(b[0])) {
        rep(l,sz(b)) res[i][j] += a[i][l] * b[l][j];
    }
    return res;
}
mat mat_pow(mat a, ll n) {
    mat res(sz(a), vl(sz(a)));
    rep(i,sz(a)) res[i][i] = 1;
    while(n>0) {
        if(n&1) res=mat_mul(a,res);
        a=mat_mul(a,a);
        n >>= 1;
    }
    return res;
}
int main() {
    string s;cin >> s;
    //int a = stoi(s.substr(1,s.size()-1));
    int a = stoi(s.substr(0,s.size()-4))*1000+stoi(s.substr(s.size()-3,3));
    ll x,y;
    for (int i=1;i<=1000;i++) { 
        if ((a*i)%1000==0) {
            x = i;
            y = a*x/1000;
            if ((x+y)%2==0)cout << "A" << " ";
            else if (x%2) cout << "B" << " " ;
            else cout << "C" << " ";
            break;
        }
    }
    if (x<y) swap(x, y);
    //cout << x << endl;
    //cout << y << endl;
    cout << x+y-2+(x+y)/2+(x-y)/2 << endl;
}
            
            
            
        