結果
問題 | No.1422 Social Distance in Train |
ユーザー | wawawa113 |
提出日時 | 2021-03-16 22:16:23 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 8,359 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 97,484 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 17:25:39 |
合計ジャッジ時間 | 1,607 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
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 | - |
ソースコード
#include <iostream> #include <string> #include <set> #include <iomanip> #include <deque> #include <vector> #include <map> #include <utility> #include <algorithm> #include <math.h> using namespace std; using ll = long long; #define INF 1ll << 60 bool localTest = false; long long readLongLong() { long long t; cin >> t; return t; } std::vector<ll> readVector(long long size) { std::vector<ll> v(size); for (long long i = 0; i < size; i++) { cin >> v[i]; } return v; } class CodeForcesPrint { public: CodeForcesPrint operator<<(int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long long n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long unsigned int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long long unsigned int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(double n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long double n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(std::vector<long long> v) { CodeForcesPrint tmp; for (long unsigned int i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << endl; return tmp; } CodeForcesPrint operator<<(std::vector<std::vector<long long>> finalAnswer) { CodeForcesPrint tmp; if (localTest) { cout << "--final answer--" << endl; } for (long unsigned int i = 0; i < finalAnswer.size(); i++) { for (long unsigned int k = 0; k < finalAnswer.at(i).size(); k++) { cout << finalAnswer.at(i).at(k) << " "; } cout << endl; } return tmp; } CodeForcesPrint operator<<(char s) { CodeForcesPrint tmp; cout << s << endl; return tmp; } CodeForcesPrint operator<<(string s) { CodeForcesPrint tmp; cout << s << endl; return tmp; } CodeForcesPrint operator<<(std::vector<string> finalAnswer) { CodeForcesPrint tmp; if (localTest) { cout << "--final answer--" << endl; } for (long unsigned int i = 0; i < finalAnswer.size(); i++) { cout << finalAnswer[i] << endl; } return tmp; } }; template <class T, class U> std::vector<U> permutation(std::vector<T> vec, std::vector<T> before_list, std::vector<U> after_list) { std::vector<U> res(vec.size()); for (long unsigned int i = 0; i < vec.size(); i++) { for (long unsigned int k = 0; k < before_list.size(); k++) { if (vec[i] == before_list[k]) { res[i] = after_list[k]; } } } return res; } template <class T, class U> vector<U> permutationRead(long long size, std::vector<T> before_list, std::vector<U> after_list) { vector<T> t(size); for (long unsigned int i = 0; i < size; i++) { cin >> t[i]; } return permutation<T, U>(t, before_list, after_list); } long long readTestcaseSize() { ll t; cin >> t; return t; } #define inTest \ ll t = readTestcaseSize(); \ for (ll testcase = 0; testcase < t; testcase++) class OddNumber { }; class EvenNumber { }; bool operator==([[maybe_unused]] OddNumber oddNumber, long long n) { return n % 2 == 1; } bool operator==([[maybe_unused]] EvenNumber evenNumber, long long n) { return n % 2 == 0; } bool operator==(long long n, [[maybe_unused]] OddNumber oddNumber) { return n % 2 == 1; } bool operator==(long long n, [[maybe_unused]] EvenNumber evenNumber) { return n % 2 == 0; } #define ll(name) long long name = readLongLong() #define llV(name, size) std::vector<long long> name = readVector(size) OddNumber Odd; EvenNumber Even; CodeForcesPrint print; //________________________________________________________________________________ #define rep(name, n) for (long unsigned int name = 0; name < n; name++) #define rep1(name, n) for (long unsigned int name = 1; name < n; name++) #define string(name) \ string name; \ cin >> name; class NumString : public string { private: string s_; vector<long long> nums; long long length_; long long number; public: NumString(string s) : s_(s) { for (long unsigned int i = 0; i < s.length(); i++) { nums.push_back((ll)s[i] - 48); } length_ = s.length(); number = 0; ll tmp = 1; for (long unsigned int i = 0; i < s.length(); i++) { number += nums[i] * tmp; tmp *= 10; } } NumString(long long n) { number = n; string s = to_string(n); s_ = s; for (long unsigned int i = 0; i < s.length(); i++) { nums.push_back((ll)s[i] - 48); } length_ = s.length(); } long long getNumber() { return number; } long long length() { return length_; } long long &operator[](long long index) { return nums.at(length_ - index - 1); } vector<long long> getNums() { return nums; } }; #define all(v) v.begin(), v.end() #define yes print << "Yes" #define no print << "No" class ULString { private: string s_; long long length_; long long upper_case_letter_numbers; long long lower_case_letter_numbers; const long long border = 94; //no problem if this is x | 91<=x<=96 const long long dis_upper_lower = 32; //note upper<lower; vector<bool> IsUppers; public: ULString(string s) : IsUppers(s.length()) { s_ = s; length_ = s.length(); upper_case_letter_numbers = 0; lower_case_letter_numbers = 0; for (unsigned int i = 0; i < s.length(); i++) { if (s[i] > border) { IsUppers[i] = false; lower_case_letter_numbers--; } else { IsUppers[i] = true; upper_case_letter_numbers++; } } } long long length() { return length_; } char &operator[](long long index) { return s_[index]; } bool IsUpper(long long index) { if (s_[index] > border) { return true; } else { return false; } } bool IsLower(long long index) { return !IsUpper(index); } string AllU() { string res = s_; for (unsigned int i = 0; i < length_; i++) { if (!IsUppers[i]) { res[i] = char(res[i] - dis_upper_lower); } } return res; } string AllL() { string res = s_; for (unsigned int i = 0; i < length_; i++) { if (IsUppers[i]) { res[i] = char(res[i] + dis_upper_lower); } } return res; } vector<bool> getIsUppers() { return IsUppers; } }; long long sum(vector<ll> v) { ll res = 0; for (unsigned int i = 0; i < v.size(); i++) res += v[i]; return res; } #define YES print << "YES" #define NO print << "NO" bool f(string s) { rep(i, s.length() / 2) { if (s[i] != s[s.length() - i - 1]) return false; } return true; } int main() { ll counter=0; ll res=0; // ll(N);llV(x,N); // ll res1=0; // rep(i,N)res1+=abs(x[i]); // long double res2=0; // rep(i,N)res2+=x[i]*x[i]; // res2=sqrt(res2); // ll res3=-INF; // rep(i,N)res3=max(res3,abs(x[i])); // print<<res1; // cout<< setprecision(15)<<res2<<endl; // print<<res3; ll(N); if(N==Even){ print<<1; }else{ print<<2; } }